Running a script once a day

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
wizzard81
Forum Commoner
Posts: 66
Joined: Wed Jan 15, 2003 6:05 am
Location: Belgium
Contact:

Running a script once a day

Post by wizzard81 »

Hello,

I'm having a script that i want to run once a day. My problem is my hosting provider doesn't allow me to use the Crontab. Are their other ways to run a script once a day?
hunterhp
Forum Commoner
Posts: 46
Joined: Sat Jan 22, 2005 5:20 pm
Contact:

Post by hunterhp »

Not likely, unless you have your computer on every day, and have the task manager open a browser window on your specified URL(Which I don't think is possible, atleast with my Windows version).

Try asking your host for cron jobs.
DMcK
Forum Newbie
Posts: 7
Joined: Tue Nov 02, 2004 4:43 pm

Post by DMcK »

Here's a kludge for you...If you don't need the script to run at exactly the same time and you have enough visitors to your website, then you can add some code in your index.php that just checks a table in your database to see if you have already run the code for the current day; if it hasn't you run the script and update the database to indicate the script has run.

Doug
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

there are also service providers like http://www.webcron.org
User avatar
Joe
Forum Regular
Posts: 939
Joined: Sun Feb 29, 2004 1:26 pm
Location: UK - Glasgow

Post by Joe »

Do you have the ability to execute software on your server. If so you could develop an application in C which runs the specified URL at a given time.
Post Reply