Two ways I can think of to update part of a page without doing a full refresh:

1. Use an IFRAME so you're technically updating a page, but it's the page 
within the frame (not my favorite but works ok)

2. Or you can use asynchronous javascript (AJAX) to update just that one 
section of the page without doing a refresh.  Here's Rasmus' great primer on 
AJAX, should be easy enough to follow:

One note I'd like to make that doesn't seem to be mentioned in a lot of AJAX 
tutorials.  If the page your AJAX is calling doesn't have the standard "do not 
cache" tags, you sometimes won't get the results you want.. especially with 
Internet Explorer (in my experience).

Here's a block I copy/pasted from somewhere that seems to work fine (covers 
most of the bases and all):

header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always 
header("Cache-Control: no-store, no-cache, must-revalidate"); // HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false); // HTTP/1.1
header("Pragma: no-cache"); // HTTP/1.0

good luck!


= = = Original message = = =

  No, no that is not what i am after, I know how to do that but it's not what I 
  I wrote some code a year or so ago with words, they refreshed every 5 or so 
seconds WITHOUT REFRESHING THE PAGE.  It was written in JavaScript as i can 
remember.  But I can't find where I did it. I want to have the code or a 
similar one without the need to re-write it.  
  The code does not require the page refreshing at all, just loops in a script 
and outputs.  I might have to do some web surfing on it, pity I can't remeber 
where it is.
  If anyone could help that would be great.
  It's for a PHP site using MySQL.  I am considering having the slogans in a 
database this time rather than just a text file.

Julien Bonastre <[EMAIL PROTECTED]> wrote:
  Yes I can help you there..

There is a technique you can use which is actually more "browser" 
friendly then the Javascript alternative you mentioned..

You can use the META tags in your page as such:


will refresh page in 10 seconds


will reload page in 10 seconds and direct browser to one of my first 
highschool webpages..

For a quick reference I found this via the I'm Feeling Lucky of Google:

Otherwise the good ole' W3C at will have some great doco's 
on it too

enjoy ;-)

Sent by ePrompter, the premier email notification software.
Free download at

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to