i want to make a link that is valid only for 24 hours, this is for a validation purpose, so my question is simple:
How do i make this link valid only for this time; i’ve a hint:
- Get the epoch time.
- Make a link using only this value: something.com/time/1359380374
- When the user clics on the link, extract this value and compare.
I hear about Hash values? why? we cant get the time from the hash value (invert the process) so how this is done?
Your best bet is to have the users email send as an argument and then query the database to see if their link has expired:
Requested link query:
update users set locked_stamp = now();Request url:
http://yourdomain.com/?email=useremailQuery:
select true from users where email = '$email' and locked_stamp > now()-interval 1 hour and now() limit 1Result: You have a person requesting within the hour with email:
$email.I have a script that using base64 to encode the timestamp… but its not secure by any means.