How to do automatic refresch script in php

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
teketen
Forum Newbie
Posts: 4
Joined: Mon Jul 18, 2005 7:45 am

How to do automatic refresch script in php

Post 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
ckuipers
Forum Commoner
Posts: 61
Joined: Mon Mar 24, 2003 6:10 am

Post 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
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post 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
-
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

you could create a javascript and setTimeOut(function(), 1800000)
if that would be practical
djot
Forum Contributor
Posts: 313
Joined: Wed Jan 14, 2004 10:21 am
Location: planet earth
Contact:

Post 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
-
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Don't forget: Windows Scheduled Tasks is a powerful tool.
Post Reply