Refreshing browser content upon expiration of time interval

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
dickey
Forum Commoner
Posts: 50
Joined: Thu May 16, 2002 8:04 pm
Location: Sydney, Australia

Refreshing browser content upon expiration of time interval

Post by dickey »

Am I able to update data on a window based on the expiration of an interval of time?

for example: the code below displays:

Sydney, Australia - Tuesday, 18 June 2002 11:35AM (based on the PHP date function).

Code: Select all

echo "Sydney, Australia - ".date("l, j F Y g:iA");
How am I able to force this to refresh in the browser say at an interval of 1min?

Any assistance would be greatly appreciated.


- Andrew
User avatar
roninblade
Forum Newbie
Posts: 21
Joined: Thu Jun 13, 2002 7:12 pm

Post by roninblade »

you can use meta refresh

Code: Select all

<meta http-equiv="refresh" content="1">
User avatar
Wayne
Forum Contributor
Posts: 339
Joined: Wed Jun 05, 2002 10:59 am

Post by Wayne »

content="1" ... this is in seconds so for 1 minute content="60"
User avatar
e+
Forum Commoner
Posts: 44
Joined: Mon Jun 17, 2002 7:07 am
Location: Essex, UK

Post by e+ »

The only problem is that unless the information is in a little white background frame when you refresh the entire page will reload :( . Most users don't like this sort of thing. Have you thought about using something client side to display the time, javascript tends to be good for this sort of thing.
User avatar
roninblade
Forum Newbie
Posts: 21
Joined: Thu Jun 13, 2002 7:12 pm

Post by roninblade »

Wayne wrote:content="1" ... this is in seconds so for 1 minute content="60"
sorry bout that.
Post Reply