• Welcome to Valhalla Legends Archive.
 

How should I make my email verification?

Started by warz, June 19, 2006, 12:26 PM

Previous topic - Next topic

warz

I'm creating one of those scripts that verify your email address before youre account becomes active when registering, by sending an email to the address you specify.

I'm thinking though - when a user tries to register, what I will do is basically create their account but flag it "unactivated". Ill also store an entry in a different sql table with an 'id' value representing their account, and a 'code' value. Ill send these values in an email to the supplied email (in URL format, much like most other scripts like this do).

For the user to activate, they much properly access my php script and supply their 'id' value with their correct 'code' value. Then, I will flag their account 'activated', delete their table entry in the 'waiting to be activated' table and their account will be fully registered.

What should I base the 'code' value off of, though? I was thinking, since only 1 email may be registered with the same name, I could make the code value the first 10 digits of the MD5 result of their email address. Something similar to...

if($suppliedcode == substr(md5($emailaddress), 0, 10)) then activate!

What do yall think?

dxoigmn

It should be random, otherwise people can create accounts with fake email addresses if they figure out your scheme.

rabbit

#2
I did something else.  The file is a class, which is a loaded as a module by a sytem I wrote for my senior project.  It works well, but there's some requirements in there (like some of my other classes), though they shouldn't be hard to replace. Take a look:

http://www.liquid-server.org/register.phps

If you want the full site source, talk to me.

[edit]
This will maybe help:
http://www.liquid-server.org/register.form.tpl.phps
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

warz

Meh, it's difficult for me to look at other peoples code sometimes - and your code is just confusing to me. I think it's a little more than what I'm needing to do but I appreciate the willingness to share. I managed to get my method running and I think it'll work out fine.

rabbit

O well.  The MIME headers for the email are down near the bottom, if you need them.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Warrior

Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Banana fanna fo fanna


rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Banana fanna fo fanna


Warrior

Quote from: Banana fanna fo fanna on June 23, 2006, 11:01 PM
Good point. Still silly.

* Warrior frowns at BananaFFF

Actually lol I think it was based off my original module system somewhat but rabbit-ified. I thought  it was a good idea for a CMS I was developing at the time. Of course now instead of creating an interface for modules to communicate with I pass them a reference to the core and have allowable functions monitored on a by-caller basis in PHP.  I think most of this is a result of me overcomplicating everything when I was a novice PHP coder.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

rabbit

It is based (loosely!) off of DTCMS's module system, and yes, I did modify it heavily.  I didn't have a lot of time to write everything, so I went with a basic system I know and had and implementation for.  If you STILL think its silly, go read littlegamers to find out what silly really is.  Good day.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

Banana fanna fo fanna

Silly because it's over-engineered. However, "it works well for me" is ALWAYS a certainly reasonable reason for taking a given choice of action.

rabbit

Yes.  It is overengineered.  But it's also alone.  Looking at the whole site makes it less overengineered looking (though I suppose it all still is).
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

warz

i just use php's emailing functions. it's basic, and simple.