ok.. Ill explain the above script.
This script user makes request by enterign the email associated with their account. IF it is a valid email which is connected with a account a entry is made to my pword_reset table
It adds a randomly generated string of 50 numbers and letters (not on this version but it is...) the email their user_id AND also the request time (in unix time) and also a expire time which is generated by adding 60*60*48 to the current unix time.
It emails the user with a url the url is like forgot.php?email=myaccount_email@dan.com&verify=My Special50characterlongcodewhichisinthetable
Then the user clicks the link they go to the page and IF the user has requested their password there will be a entry with that code for that account.
If it all checks out it provides two fields to enter a new password (and confirm it) submit and it overwrites their password.
I will also be running a CRON job which deletes all entries where the expire time is less than the current unix time. there-fore deleting all entries older than 48 hours. providifing more security
Its fairly simple. but i can be fairly dumb as well 
__________________
Discounted Web Hosting With XDnet! >> Get 25% of hosting~ Promo: Webmaster-talk <<
|