Update

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
Silver_Eclipse
Forum Commoner
Posts: 61
Joined: Sun Aug 18, 2002 7:26 pm

Update

Post by Silver_Eclipse »

does anyone know how to make a window refresh in a set amount of time after it loads?
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

<meta> tags, google it.
Silver_Eclipse
Forum Commoner
Posts: 61
Joined: Sun Aug 18, 2002 7:26 pm

Post by Silver_Eclipse »

well i was actually looking for a way to do it with php heh
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

since php is not run on the client side you can't use it to force a refresh on the users browser. you could however use php to quickly modify the refresh rate:

Code: Select all

&lt;?php
$refreshValue = 30; //seconds
?&gt;

&lt;meta http-equiv="REFRESH" content="&lt;?php echo $refreshValue; ?&gt;" /&gt;
User avatar
Takuma
Forum Regular
Posts: 931
Joined: Sun Aug 04, 2002 10:24 am
Location: UK
Contact:

Post by Takuma »

Code: Select all

<meta http-equiv="Refresh" content="SECONDS;FILENAME">
That's the META way or you could use Javascript.

Something like

Code: Select all

function refresh_page() &#123;
  location.href="FILENAME";
&#125;
setTimeout("refresh_page()",TIMEINMILLISCONDS);
User avatar
hob_goblin
Forum Regular
Posts: 978
Joined: Sun Apr 28, 2002 9:53 pm
Contact:

Post by hob_goblin »

Code: Select all

<?
sleep('10');
header("Location: http://www.foo.bar");
?>
Post Reply