Re: Periodic Actions in PHP?
| From: | Richard Heyes | Date: | Sat, 13 Jun 2009 09:17:18 +0000 |
| Subject: | Re: Periodic Actions in PHP? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-294000@lists.php.net to get a copy of this message | ||
Hi,
> I'm going to create a small chat script with PHP. The messages you want others to see
> will be added to a flat file (I.E. TXT file), and read and displayed by PHP. However, I want
> this reading and displaying to be periodic. This means that I want PHP to check the file for
> new lines every,say, fifteen seconds. How may I do that? I have been unable to find any
> function that acts like a timer.
If you're on Unix then look into using cron. Type the following at the
command prompt to get info on cron:
man 5 crontab
Cron tasks can be scheduled at most once per minute. And if you're
using Windows then I believe the equivalent would be task scheduler,
but I've no idea how you would go about using it.
--
Richard Heyes
HTML5 graphing: RGraph (www.rgraph.net - updated 6th June)
PHP mail: RMail (www.phpguru.org/rmail)
PHP datagrid: RGrid (www.phpguru.org/rgrid)
PHP Template: RTemplate (www.phpguru.org/rtemplate)
PHP SMTP: http://www.phpguru.org/smtp