Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Signup confirmation - confirmation code 1

Status
Not open for further replies.

namida

Programmer
May 29, 2003
101
AU
I want to instil an email checking method whereby all users that signed up will receive an email with a confirmation code. Clicking on the link with the confirmation code will confirm that the email is true and therefore truly registering that person.

How to come up with the confirmation code? I think alphanumeric combination would be best. Do i just simply randomize characters or use a certain formula?

Next question is, what if the email bounces back? I don't want hundreds of bounced emails coming up to my mail. How do I make the mySQL decide that it is time's up for the user confirmation without me doing a search everyday?
 
I use the md5(time()); command, that gives a unique confirmation code and then I store that in a database with the email address. then email is then sent with the link to the page that checks the database. if the link was the same as the value in my datbase then the account is activated.

as for bouncebacks. simply set the reply to address to an account that either doesnt exist or can automatically delete emails. as you will only be sending the email once you will only gt one bounceback.

Kindest Regards
Jamie
 
thanks a lot!.

How about the time out.
For example if the user did not confirm after 48 hours his/her info is deleted. HOw do I do that?

 
you need to store the date in you database then query it using

"DELETE FROM table_name WHERE datefield>time()-172800"

you may need to store time()-172800 as a variable first.
(172800 is the amount of seconds in 48 hours)
you could either stick this on a crontab (havn't a clue how but you can do it) or simply run in manually, I would run it anytime someone posts a new request.

Hope that helps.

Kindest Regards
Jamie
 
Ic.. so I'll try it!!
I'll probably start another thread on how to make crontab?!
 
:)


sorry namida I made a mistake before

&quot;DELETE FROM table_name WHERE datefield<time()-172800&quot;

Like I say, so long as you execute that SQL statement before adding any new ones it will be just as good as using the crontab.
some servers won't allow access to the crontab.

Kindest Regards
Jamie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top