Expire a hash in a database
Posted: Mon Oct 10, 2005 6:23 pm
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?
$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?