Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP Timer Script

Status
Not open for further replies.

kurie

Programmer
Jun 4, 2008
170
ZA
Hi all
Does anyone know how to write a timer script. Like something that runs/triggers after every hr.

Thansk
 
set up a cron job on the server, that runs a php script.

Olav Alexander Mjelde
 
Hi

You mean a cron / task scheduler ?

Such things are daemons / services - they run non-stop in the background. So they can not be started from the web server.

Do you have permission to run such scripts ? If yes, set up a cron job / scheduled task. If not, use a web service like Free Web Cron Scheduler.

Feherke.
 
i m not using unix/linux, im on windows platform, so cant use crontabs
 
If you have access to the server, you could do:
1. Make your janitor.php script (for your timer task)
2. In the janitor.php, have a meta-refresh with a timer (or JS would work fine too)
3. Start the file in the browser, on the server (needs to be logged in to start this).

Then the janitor script would refresh it self at the interval of your choosing. You could also then check if the visitor is != localhost, as an security measure.

Olav Alexander Mjelde
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top