Confirm registration email address with PHP?
Moderator: General Moderators
- JAB Creations
- DevNet Resident
- Posts: 2341
- Joined: Thu Jan 13, 2005 6:44 pm
- Location: Sarasota Florida
- Contact:
Confirm registration email address with PHP?
So I have registration working just fine and dandy locally and would like to have folks who register confirm their email addresses actually exist. I would imagine the essentials would be to create some sort of URL with a unique string that is stored in the DB, sent in an email automated by PHP, and compared when clicked to validate the email address. I'm not sure where to start however. Any good examples or good threads to share?
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
It's not complicated at all
1) User registers at your site, insert record into the database
2) Update user record with a unique id of some sort, md5($username. rand(0, 100000) . microtime()) for example
3) Send the email with a link containing the unique id, i.e.http://domain.com/confirm.php?id=YOUR_UNIQUE_HASH
4) Check for the existence of the hash in the database
5) If found, update user record to confirmed
1) User registers at your site, insert record into the database
2) Update user record with a unique id of some sort, md5($username. rand(0, 100000) . microtime()) for example
3) Send the email with a link containing the unique id, i.e.http://domain.com/confirm.php?id=YOUR_UNIQUE_HASH
4) Check for the existence of the hash in the database
5) If found, update user record to confirmed
- superdezign
- DevNet Master
- Posts: 4135
- Joined: Sat Jan 20, 2007 11:06 pm