Refresh a page in continuous mode ...

A

Anonymous

Guest
Hello all

I am writing a Chat script,
I need a page to be refresh in Continuous mode ,
I can refresh a page using META but id doesnt like so good !
It will rewrite the page with flickering and some weird stuff ...

so any idea how can I refresh my page Continuous without
any problem ?

or please give me idea about how to refresh a CHAT PAGE ...

I appreciate that
 
I believe that i answered a similar post before, but i'd have to check...
there are many ways you can do this, meta tags are not the best, but other ways tend to require JS or DHTML. I would take a working Chat script from here and use it instead of reinventing the wheel... but if I really wanted to write my own, I would still take a look at one of the scripts, just to get an idea of how others do it. Oh, i think you can use header() function in a very creative way to reload...
 
Thanx a lot for your answer
but I would like to write my own
as I want to use this chat room in
a commercial web site so I cannot
user these free GPL chat rooms ...

Ive seen a chat room called VOODOO
in the web site you gave me on this address :

http://demo.vochat.com/

it has a Continuous mode for refreshing page
but I cannot find its command in their PHP files

can U help me on this plz ?
 
Code:
<html>
<head>
<?php
include("inc_common.php");
set_variable("url");
echo "<meta http-equiv=\"refresh\" content=\"0;URL=".$url."\">";
?>
<body>
<a href="<?php echo $url; ?>">press</a>
</body></html>

That is in the 'go.php' file - seems to be all that get's it to refresh as far as I can tell.

Hope that helps

Andrew
 
WoozyDuck said:
as I want to use this chat room in
a commercial web site so I cannot
user these free GPL chat rooms ...

You have a fundamental misunderstanding of the GPL.
 
bezmond said:
Code:
<html>
<head>
<?php
include("inc_common.php");
set_variable("url");
echo "<meta http-equiv="refresh" content="0;URL=".$url."">";
?>
<body>
<a href="<?php echo $url; ?>">press</a>
</body></html>

That is in the 'go.php' file - seems to be all that get's it to refresh as far as I can tell.

Hope that helps

Andrew

HI mate

thanx a lot for your answer
Well this file contains a like of code which is a META for refreshing
the page , Ive tried using the same META , like refreshing the
page every 2 seconds , but it gives me a lot of flickerin!

I have another idea , can I read the chat content in an hidden frame
and then write the changes to my main frame ?
in this case I will need a command to re-write a content in
an HTML page , can we do this anyway ?
 
swirlee said:
WoozyDuck said:
as I want to use this chat room in
a commercial web site so I cannot
user these free GPL chat rooms ...

You have a fundamental misunderstanding of the GPL.

Thanx
your right
I dont know anything about GPL ...
could you please direct me to a page or something
which I can read about this copyright ?
I appreciate that
 
An easy way of creating a Chat script is by using a file to store the 10 or 20 last messages in, and reading it on an iframe every 4" using the META Refresh function. The page stays static and the iframe keeps refreshing with new posts
 
The GPL is a license, not a "copyright." And the first result for GPL on Google is the official GNU copy of the GPL, which is as well as you're apt to do for information about the GPL.
 
mike said:
An easy way of creating a Chat script is by using a file to store the 10 or 20 last messages in, and reading it on an iframe every 4" using the META Refresh function. The page stays static and the iframe keeps refreshing with new posts

Thanx a lot mike
I can do that , but that iFrame will flick as well
the place I like to show my messages ,
actually I do the same , I keep messages in a file
and read it from server every few seconds and
load it to the chat page ,
but everytime I load the page , it goes on the top
and I have to scroll it via script to the bottom ,
so it flicks a lot specially in Netscape ,
can we add some text in bottom of the page dynamic ?
 
swirlee said:
The GPL is a license, not a "copyright." And the first result for GPL on Google is the official GNU copy of the GPL, which is as well as you're apt to do for information about the GPL.

Thanx a lot swirlee
I got it
:)
 
Hmmm I forgot to write down this trick :D

Code:
<body leftmargin="0" topmargin="0" onload=window.scrollTo(0,99999);>

And also, if you want the newer messages shown from bottom to the top use something like this:

Code:
$messages = file("data.txt"); 
$messages = array_reverse($messages);
 
Thanx mike
I use this command to scroll window to the bottom :
Code:
 document.body.scrollTop = document.body.offsetHeight;

but I will try urs as well ,
I hope this time window doesnt flick anymore.

Cheers
 
There are much more you should also do for your chat... think what will happen if someone will post a 100-character-long word like this:

"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

The table/frame will be streched out! You can make a small function cutting down long words
 
that is right
Ive sort that out , I sort out everything about user's characters
but my problesm is just refreshing the page :( which is aweful !

Ive found a JavaScript function to RE-WRITE a content on the page !
here :
http://www.howtocreate.co.uk/tutorials/jsexamples/rewritediv.html

I am working on it how can I control that iFrame from another page frame
like I have 2 frames for my chat page , the one who users types in,
and another one which is for showing the messages !

with re-writing idea I think I can refresh the content on the page only
instead of refreshin the whole of it , that would be nice , isnt it ?

but I dont know yet how can control an iFrame from outside a frame ,
please take a look at the link Ive given before and help me about
this if you can.

Regards
 
Hmm easy :-D

put the following java thing into the page containing the "form" for posting messages. Assume that your frame or iframe is named as "msgbox" and its html source is "msgbox.php" eg:

<iframe name="msgbox" src="msgbox.php" width="110" height="150" noresize frameBorder=0>

So every time a message is posted, the page is reloaded showing the new post!

Code:
<SCRIPT>

</SCRIPT>
 
Thanx a lot mike for the answer ...
but I still have some problem :(
Sorry I am a newbie ...

here is my code for TOP frame (main.htm):

Code:
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 2</title>
</head>

<body>

<p align="center">

<iframe name="msgbox" src="http://www.google.com" width="505" height="276" noresize frameBorder=0> 

</body>

</html></p>

and the code for bottom frame (menu.htm) :

Code:
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<META HTTP-EQUIV=Refresh CONTENT="3; URL=menu.htm">

<title>New Page 3</title>
<base target="top">

<SCRIPT LANGUAGE = "JavaScript">

</SCRIPT>

</head>
<body onload="reload()">

<p>THIS PAGE WILL RELOAD THE TOP FRAME!</p>

</body>
</html>

and here is the source for FRAMES PAGE file (index.htm) :

Code:
<html>

<head>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>

<frameset rows="*,59">
  <frame name="top" src="main.htm" scrolling="auto">
  <frame name="footer" scrolling="no" noresize target="main" src="menu.htm">
  <noframes>
  <body>

  <p>This page uses frames, but your browser doesn't support them.</p>

  </body>
  </noframes>
</frameset>

</html>

It doesnt work !
Could you please tell me what I am doing wrong with this code ?
I really appreciate that
 
I've found the problem !
We should add a parent. word in to the begining of the command :
Code:
parent.top.msgbox.location="http://www.yahoo.com";

it works now ,
:-D
 
Back
Top