auto-running script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dim_hatzi
Forum Newbie
Posts: 1
Joined: Sun May 03, 2009 4:00 am

auto-running script

Post by dim_hatzi »

hi everybody,
i would like to know if there is a possibility in php, to create a script, in order to call a .php file by scedule, for example every 1 hour... at server side...

thank you very much

dimitris - greece
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: auto-running script

Post by requinix »

It's called cron, or the task scheduler for Windows.

Go be creative.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: auto-running script

Post by requinix »

Discuss? I kinda hoped the Google link I gave would be enough.

The exact mechanism depends on whether you use cron or the task scheduler. Either way, somewhere there is a rule that says that something should be done at a certain time. This happens automatically - you don't need to worry about your code checking the time or anything, the server does that for you. And when the time is right it executes your command.

Your command is to tell PHP to run some file of yours. The script loads, your code runs, and everybody's happy.
Post Reply