View Single Post
Old 07-18-2010, 02:39 AM   #5 (permalink)
Krik
The Contributor
 
Join Date: Feb 2009
Posts: 65
Thanks: 0
Krik is on a distinguished road
Default

Writing up all the code and explaining it would be a very long post. I would suspect through explanation would be up around 10 printed pages. Just the code alone looks to be a minimum of 50 lines. And really just about every line would need a sentence or two to explain.

Now I have never had do what you need done but to do it I would go dig up code from several other projects and then use them together. And as all the various parts of the code, that I would use, I learned by research I thought the best idea would be to direct you to the information you need to do this. As this would let you learn things you may be able to use in future project.

First, I don't know if you know how to work with a databases so if you don't already you will need to know how to setup, access, and insert data into a database. As most hosts have MySQL I would recommend it for your database.

To setup a database your host will usually have tools that allow you to do this easily and may have a tutorial you could follow. To access data or insert data in a database you will find several tutorials online, as well php.net has all the php functions with examples and user comments (that have variations). Just look for all the function that are for working with a MySQL database.

Second, you will need be able to create a unique id. The code I have for this I learned when I was looking up how to generate passwords for people who forgot their password to an account.

That unique id will get stored in the database and passed to the next page in the url. You will want to use php.net to learn more about the $_GET super global for sending data in a URL and retrieving it.

Third, will also need to know how to work with a unix time stamp so again use php.net and check out the "time()" function.

Lastly you need to know how to send the user packing when there is no unique id or if it has expired and this is where you could use the $_SERVER['HTTP_REFERER'] combined with the "header" function, again look it up on php.net

Of course for each of these different areas you can do a google search and find other information as well.

I would only add that as you go along if run into a problem feel free to ask.
Krik is offline  
Reply With Quote
The Following User Says Thank You to Krik For This Useful Post:
grigione (07-18-2010)