Posted by Andrew @ Rockface on 11/12/59 11:28
chotiwallah wrote:
> not possible using php only.
>
> three possible ways around:
>
> 1. use some web based cron (can't remember an url at the moment, sorry)
>
> 2. if you have a local pc that's online 24h, have a little program
> there calling the automated script every x seconds
>
> 3. use the most frequented page of your website to call the automated
> script (using a blind image, for instance). you'd have to include a
> timer in the automated script than.
You could use an infinite loop and stick the code to be executed inside
with a sleep at the end.
$x = 5;
while(1) {
echo "Hello world";
sleep($x);
}
Or if you want to re-execute the code a set number of times use:
$x = 5;
$y = 10;
for ($c = 0; $c < $y; $c++) {
echo "Hello world";
sleep(5);
}
--
Andrew @ Rockface
np: Sylvie - Smoke and Mirrors [stopped]
www.rockface-records.co.uk
Navigation:
[Reply to this message]
|