Jump to content

PHP time


deltajam_v

Recommended Posts

what about something like this ...

1. Randomly generated password is created and written to a temp database field.
2. User attempts to login and the script checks the password used to enter with the password stored in the DB.
3. It also checks the date/time of the random pass, and verifies if its been a 24hrs or not
4. If it has been more than 24hrs since the last pass was generated, it generates a new password and stores it in the DB

might this work instead of using crontab?

Ps ... absolute newbie to crontab ... have no idea where I would start with that ...

Thanks

Link to comment
Share on other sites

That would work although it wouldn't be that accurate in terms of having the password active for exactly 24hrs.  You would have to make sure that, to keep the 24hrs time frame, someone would login after the 24hr period has elapsed.  Would be fine for a high traffic website but could prove a problem for one with low traffic.

To be honest, crontab is the way to go.  It isnt to hard to set up once you know what your dealing with.
Link to comment
Share on other sites

PHP and MySQL are what drive your website.  They're installed on webhost computer which can be running any server OS.  As long as the OS provides automated task scheduling, you can schedule your site to do anything.

Try going to http://www.google.com and searching for:
crontab
cron jobs

Look for the pages pointing back at wikipedia as a starting reference.
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.