Jump to content

Archived

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

deltajam_v

PHP time

Recommended Posts

Hi, I have a randomly created password that I would like to somehow automate to change everyday.  However, I would like that password to stay the same for 24hrs and then change.  Is there a way to automate this without creating a cron job?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
I have zero experience with crontab.  My site is hosted with iPower ... so php & mySql.  I always thought cron was a linux thing ... excuse my ignorance please ..

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
Sorry for the slow response, cron jobs are usually something provided as part of your web host control panel.  My webhost has cPanel which has an icon for Cron Jobs.  Check with iPower to see whether and how they offer Cron Jobs.

Share this post


Link to post
Share on other sites

×

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.