Jump to content

difference in time- mainly if over 24 hrs


meltingpoint

Recommended Posts

Problem;  Need to check to see if someone who requested a password re-set has done so with in 24hrs.  IF not- then it needs to prompt them to re-submit the request and deletes the previous re-submit code sent to them in their email.

 

I have everything else figured out (deleting re-set code) but I have not figured the checking of if they have done so within the 24hr time period.  Please tell me if the code below will accurately tell me if they complied with the 24 hour rule.

$time1 = '1284675867';// logged at the time of password re-set request.  Retrieved from database
$time2 = time();// captured in script when they actually re-set their password
$difference_between = $time2 - $time1;
if($difference_between >= '5,200,000')
{
echo "Sorry- you have exceeded the 24 hr rule and need to re-submit your request";
}

 

Compared to all that I have seen.........it appears rather simplistic.  Am I missing something or will this simple approach work?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.