Scheduled script activation....(question)

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
Alzeric
Forum Newbie
Posts: 4
Joined: Sun May 18, 2003 12:55 am

Scheduled script activation....(question)

Post by Alzeric »

Well i'm not really sure of the proper terminology for this, but I'm interested in how to have a certain script ran at a certain time during the day. (ie. have a update script ran that would cycle through my database for all my users and preform certain actions on their accounts, such as add action points for a game taht are replenished every x ammnt of min/hrs)

~Alzeric
mikeT
Forum Newbie
Posts: 7
Joined: Sun Jul 14, 2002 4:32 pm

I think you need CRON!

Post by mikeT »

This is a great article on cron...

http://www.htmlcenter.com/tutorials...ls.cfm/155/PHP/

I have had no problems using the "Apache Module" method described here..

good luck!
Alzeric
Forum Newbie
Posts: 4
Joined: Sun May 18, 2003 12:55 am

Post by Alzeric »

I got a bad link going there, does this work on ISS as well?
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

You will need to run a cron-job - i.e. a server-side timed-execution program that calls and executes scripts at a certain interval.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

If you are running windows...

Start > Programs > Accessories > System Tools > Scheduled Tasks > Add new task


I suggest adding a .url file so it opens the link in IE instead of an editor for php. :)

These types of files can be found by adding the site you want to open to your Favorites, which will create a .url file with that site as the destination, and all you need to do is point the Add new task wizard to that file.

And you might need some javascript to close the window automatically. Sometimes instead of opening in the current window this tool might spawn new windows on every interval.

Gatta love the simplicity of Windows. :wink:
Alzeric
Forum Newbie
Posts: 4
Joined: Sun May 18, 2003 12:55 am

Post by Alzeric »

great thx for the help, I'll worry about cron later on once I leave the development stage and go live on a hosted server.

~Alzeric
Post Reply