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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.