PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am making a site where you pay for a packet of information, and once you sign up, it puts a hash of the following string:
$timestamp.$orderID.$customerip
I then store that information in the database, and when the customer wants to download the packet, they just have to follow a link with that hash appended to the url, I will have the page check that it is a valid hash, and then let them download the file. I want the hash that is in their database to expire after 24 hours or so... is there a way that you can change the hash stored in the database after 24 hours?
Also... how would I make it so that the file can't be downloaded by people other than the ones with valid hashes? Is there a way to protect files from being downloaded?
Alright... I got the time thing working... It just checks to see if 86400 seconds have elapsed. But the second part I don't know how to do.. what kind of features does php have that I can read the file with? fopen?