Redoing Webpage without frames but have logistical issue

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
irishmike2004
Forum Contributor
Posts: 119
Joined: Mon Nov 15, 2004 3:54 pm
Location: Lawrence, Kansas

Redoing Webpage without frames but have logistical issue

Post 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!
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

I think javascript within a iframe is the best solution for you..

Read this article
magicrobotmonkey
Forum Regular
Posts: 888
Joined: Sun Mar 21, 2004 1:09 pm
Location: Cambridge, MA

Post by magicrobotmonkey »

that's a useful article!
irishmike2004
Forum Contributor
Posts: 119
Joined: Mon Nov 15, 2004 3:54 pm
Location: Lawrence, Kansas

Post 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?
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

magicrobotmonkey wrote:that's a useful article!
it is! jej
irishmike2004
Forum Contributor
Posts: 119
Joined: Mon Nov 15, 2004 3:54 pm
Location: Lawrence, Kansas

Post 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 :-)
Post Reply