Forum Moderators: coopster

Message Too Old, No Replies

php refresh in html

Refresh just part of the html file.

         

shwiiing

2:23 am on Mar 11, 2003 (gmt 0)

10+ Year Member



This is the case. I have a html doc with a counter and a useronline php script. The html file is pretty basic and I have implemented the php fil like this, <?php require "useronline.php";?>
It works great. But the thing is that I want the php section to refresh it self with intervals or when someone else gets online.
The reason why I just dont use "meta refresh" is that i dont want my counter to count every time the site get refreshed.

Is there a simpel php or java way to get just part of the document refreshed?

thx!

jatar_k

2:37 am on Mar 11, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld shwiiing (that nick makes me laugh)

what about having the meta refresh use the same page name with a var in it?

<meta HTTP-EQUIV="refresh" CONTENT="2; URL=useronline.php?count=no">

then in the script something like

if ($_GET['count']!= "no") {
increment counter;
}

Tapolyai

2:40 am on Mar 11, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could use meta refresh, and still not increment the counter just by using a simple flag.

If I understand correctly you want to show how many people are "online" and update this information, without having to refresh the page manually.

Just add a flag to the php code which counts to see if there are new people and making sure you do not double count the person.

shwiiing

3:17 am on Mar 11, 2003 (gmt 0)

10+ Year Member



So you like my nick..hehe. From Waynes World ;)

jatar_k! I tried it. Didnt work. When it refreshed i got a blank page.
And it did refresh the hole page, i dont want that,couse u see the page loading and u hear the clicks.

Tapolyai! You speak a bit to technical for me. Not that into php yet.
What flag are you thinking of? is it much work?

jatar_k

4:09 am on Mar 11, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Tapolyai, I believe, was referring to a similar method as me.

Frame maybe or iframe? Just refresh that portion of the content?

Wayne's world, I could hear good old Mike sayin' it that's what made me laugh. :)

shwiiing

4:17 am on Mar 11, 2003 (gmt 0)

10+ Year Member



yes..just the php portion.
is it possible to do something like <iframe blabla=refresh>?