Page 1 of 1

Redoing Webpage without frames but have logistical issue

Posted: Thu Dec 09, 2004 6:55 am
by irishmike2004
Hello:

With the wonder that is PHP 5, I have determined that my script should be one page and I found that I could make this happen if I do some functions and call them when I need them. Also since there are basically three tables by which we put information on the page I thought I would simply make an array to store the html for each table and then lay it out. This is all well and good, but we are needed to dynamically update the data... I need to start with simple and then I have a complex issue. The weather table needs to auto refresh every 15 minutes, the server list for our streaming servers should refresh every 5 at the most and if someone is veiwing stats on the streams we like that to refresh every 45 seconds. currently this is done with a metadata refresh in each page that loads in a respective frame. The question is "Is there a timer function to do this within a PHP script?"

Question 2: given the code for a button:

Code: Select all

<form method="link" action="stats()">
<input type="submit" value="STATS">
</form>
will this work to call the function?

Question 3: the complex part:

We have a clock on the page that we get using

Code: Select all

date(g:i A);
It would be nice if this could be a dynamic clock that keeps running... like a Java applet would probably do this... but can PHP do it without an external applet or should we just use Java for it?

On that same question... should we implement JavaScript to refresh the data in the tables... ie call the function every x minutes.

Thanks for your suggestions and help!

Posted: Thu Dec 09, 2004 7:23 am
by AVATAr
I think javascript within a iframe is the best solution for you..

Read this article

Posted: Thu Dec 09, 2004 8:23 am
by magicrobotmonkey
that's a useful article!

Posted: Thu Dec 09, 2004 8:29 am
by irishmike2004
checked out article and it looks pretty good, I am looking for the JS clock functionality not sure if I want to try to go to the extent of the article (though it was good). I think I want to avoid frames altogether.

Thanks for the suggestion though. Other ideas?

Posted: Thu Dec 09, 2004 8:34 am
by timvw
i wouldn't use xmlhttprequest to retrieve the server time all the time....

just search the web for "javascript lock" and you'll be flooded with samples of code :p iframe, input, whatever :p

Posted: Thu Dec 09, 2004 10:06 am
by AVATAr
magicrobotmonkey wrote:that's a useful article!
it is! jej

Posted: Thu Dec 09, 2004 10:51 am
by irishmike2004
found the clock script I am going to use... now I just need a way through JS or PHP to refresh the tables at intervals :-)