Page 1 of 1

How to do automatic refresch script in php

Posted: Tue Jul 19, 2005 10:29 am
by teketen
I need to do a php script which execute automatic function for example every 30 minutes. I try to find in Internet but I don't find nothing. How can I do that?

Sorry for my English! :P

Posted: Tue Jul 19, 2005 10:40 am
by ckuipers
If you're using windows, like me, you can create a batch file to have the php script run as a task.

You can run php from your command prompt as such:
c:\php\php.exe file_name.php

Posted: Tue Jul 19, 2005 11:27 am
by djot
-
I guess you don't have access to the shell or to cron jobs. Anyway, if you have a website that is visited by your users (or by yourself/with an automated script) regualarly, you may use phpcron to execute php files.

djot
-

Posted: Tue Jul 19, 2005 11:58 am
by s.dot
you could create a javascript and setTimeOut(function(), 1800000)
if that would be practical

Posted: Tue Jul 19, 2005 12:09 pm
by djot
-
how that should be practical?

He would have to leave the browser open all day. Also the refresh will fail in approximately 1 of ten tries :)

As written in my previous post, I myself use the suggested way to let my continously visiting users of my website call some cron like php script that I coded for my needs with every page view they initiate.

Some readymade is here .

djot
-

Posted: Tue Jul 19, 2005 2:52 pm
by Ambush Commander
Don't forget: Windows Scheduled Tasks is a powerful tool.