PDA

View Full Version : Advice...


benni
02-17-2005, 03:16 PM
This is what i need:

I need a php script that will carry out a set of instructions at specific times of the day without the users being involved. The script will be executed automatically at Xpm carry out its tasks and then finish, then continue the following day at the same time. This is all done without interaction by a user.

What php functions would i need to use to be able to do that described above??

Thxs

Mhtml
02-17-2005, 04:08 PM
Well regardless of the PHP, you're going to need a way to execute it. Your host should offer chron jobs.

Fou-Lu
02-17-2005, 06:59 PM
Cron is definitly the way to go. Unfortunatly, not all hosts offer the ability to use cron jobs. Your next best bet would be to use a poor mans cron, which still requires a user to be logged in or browsing (accessing some feature of the site), but not nessessarly directly involved with the script in question.
Keep your fingers crossed that you can use cron!

benni
02-18-2005, 10:07 AM
HI there,

Thanks for your advice,

Thing is i am designing this for a project, i will be hosting the website on LocalHost do you know if this allows cron jobs ??

I dont really wont to go down the poor man's option, so are there any other options for me to use?

Thxs once again.

bcarl314
02-18-2005, 01:50 PM
On localhost? Do you mean your own computer? If so, you have the following options depending on your OS.

1) If you're running *nix (linux, unix, *bsd), you most likely already have cron, just do a "man crontab" from the command line (terminal) to learn how to set it up.

2) On Winblows, you can set up a "scheduled task" (Start -> Settings / Control Panel -> Scheduled Task) to run a script, or

3) On Winblows, you can install cygwin with Cron (I think, never tried it with cron) to schedule the task.

4) On Mac OS 10, same as 1 above

5) On Mac OS <10, no clue.

Sayonara
02-18-2005, 02:00 PM
On windows, you can deploy Apache, Mysql and PHP in one fell swoop with WAMP5 (http://www.wampserver.com/en/index.php). That includes CRON tabs.