Actually, your message sparked an idea in my [slow] mind. :)
I can put the PHP code in a java script, and tell javascript to call it 
every fifteen seconds. Best option, I think. :)
Any ideas?
Contact info:
Skype: parham-d
MSN: fire_lizard16 at hotmail dot com
email: parham90 at GMail dot com
""bruce"" <> wrote in message 
> hi...
> is this a php/web based app...
> are the users using the chat function via the browser..
> if this is a browser/web app, are you looking for a way for the
> php web app to refetch the textfile... i would assume so...
> have you figured out a rough architecture/design for your app..
> in your design, you're going to need to figure out how to
> accomplish updates to the text file, and when you do, you'll
> also have figured out how to do the reads...
> i'm assuming that you don't want a continuously running thread
> for your php/web app.. ie one continuously, never ending loop...
> -so you'll have the user add some text, the app will write this to
>  a file..
> the user will either select a refresh kind of btn, or your
> app will have to implement a refresh process, which will then
> fetch new/updated data from your files..
> etc...
> -----Original Message-----
> From: []on Behalf
> Of Richard Heyes
> Sent: Saturday, June 13, 2009 2:17 AM
> To: Parham Doustdar
> Cc:
> Subject: Re: [PHP] Periodic Actions in PHP?
> 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 ( - updated 6th June)
> PHP mail: RMail (
> PHP datagrid: RGrid (
> PHP Template: RTemplate (
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to