PDA

View Full Version : alternative to Cron


rkphpdev
10-04-2005, 07:29 PM
I am using a hosting service and they donot support cron.

I need guidances on alternatives to make my php scripts work on the same way they would have worked in cron.

Would appreciate help

Thanks - rk

Charter
10-05-2005, 07:23 AM
Not quite the same way, but you could use an IMG tag that runs the cron:

<img src="cron.php" width="1" height="1" border="0">

The cron.php file should contain something like the following:

header("Location: http://www.domain.com/images/dot.gif");
do_my_cron();

Where the do_my_cron function contains the PHP code you'd like to run.

If you use this method, then anytime some hits a page containing your IMG tag, your cron job is run.