"Budi Kelana" <[EMAIL PROTECTED]> wrote in message
> Hi,
> I want to make a web page that can retrive data from my tables
> automatically, periodically.
> Does PHP have some timer control ?
> I know we can do with JavaScript (setInterval() or setTimeOut()) but I
> cann't  join java script with PHP.
> I've tried make simple script with JavaScript to open new window that
> contain PHP script for show current time every 5 seconds.
> function showData() {
>   newWindow = Window.open('data.php','screen');
> }
> function loadData() {
>   setInterval('showData()','5000')
> }
> data.php :
> <?
>   echo date("l dS of F Y h:i:s A");
> ?>
> in result, data.php will reload every 5 seconds, but it doesn't change.
> Can someone help me and give me suggestion ?
> regards,
> Budi Kelana

 Not quite sure what you want to do...  but why don't you just
enclose your JavaScript in a PHP Script...

echo "<language = javascript>"
echo 'function Afunc(){

Or alternatively, this is the way I would approach it (and forgive
me if I'm getting a head of myself and misunderstood the question):
- if you are on a Linux/UNIX type machine you could use
Unix tools to achieve the desired effect by time intervals...
One way of doing this is to implement code that utilizes
the cron utility.  Use cron to execute a script at the desired time
intervals, the output of what ever script is executed can hence
be written to a file and read using php and finally spatt out onto your

Hope this helps...


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to