how do I redirect after a specific time period ?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
elipollak
Forum Newbie
Posts: 22
Joined: Sun Jan 19, 2003 10:23 pm

how do I redirect after a specific time period ?

Post by elipollak »

lets say I want to open a new webpage in the browser after it had been upened for 60 seconds, how would i do that in php.

So if I open a webpage, say http://www.somesite.com/index.php
how would I make it so that after 60 seconds it directs to another webpage
(or even the same one .. to update it)

I looked at php.net, but don't know quite what to search for.
It's probably simple, but I just can't find it

any help would be great

Regards,
Eli
User avatar
mydimension
Moderator
Posts: 531
Joined: Tue Apr 23, 2002 6:00 pm
Location: Lowell, MA USA
Contact:

Post by mydimension »

since php's control over the page ends after it is sent to the browser you cannot do this with php. you can however use a meta tag to achieve the same result.

Code: Select all

<meta http-equiv="refresh" content="60;URL" />
replace URL above with the url you want to redirect to.

note: moved to client side forum.
User avatar
Kriek
Forum Contributor
Posts: 238
Joined: Wed May 29, 2002 3:46 am
Location: Florida
Contact:

Post by Kriek »

header() refresh/redirect with delay.

Code: Select all

<?php header("refresh: 5; url=http://$SERVER_NAME/page.php"); ?>
header() refresh/re-direct without delay

Code: Select all

<?php header("Location: http://$SERVER_NAME/page.php"); ?>
Post Reply