
March 25th, 2000, 09:13 AM
|
|
Registered User
|
|
Join Date: Nov 1999
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
hi,
My hosting provider doesn't allow be to have cron jobs running. But I need to perform a background task every 30 minutes.
Can I simulate a cron job in PHP?
I thought I can include something like:
if ((time(now) - $lasttask)> 30 minutes){
include("task.php3")}
*don't mind the syntax, haven't checked it yet.
*$lasttask (time) could be read from a database or file.
*****ty thing is that on every pagevisit this query should be run (or on every 10th or 1000th depending on the #visitors)
*can i also include or call a cgi script (which returns no result)? ie include("/cgi-bin/task.cgi")?
Or maybe there is a much better way to simulate a cron job in PHP...?
thanks for any reply,
Quazzy
|