Page 1 of 1

Redirecting after a page has been displayed

Posted: Fri Sep 02, 2005 10:14 am
by mjseaden
Hi,

Commonly when you use header() to redirect, you get an error if any previous content has been executed.

How, then, do some websites display a message saying ('you should be redirected within X seconds - if you are not, click here') etc.?

This is what i need to do.

Many thanks

Mark

Posted: Fri Sep 02, 2005 10:32 am
by JayBird
Not done with PHP usually...it is done with simple HTML

Google for "Meta Refresh"

Posted: Fri Sep 02, 2005 10:35 am
by Burrito
js will do this for you too

you can use the setTimeout method to have it redirect at whatever time you specify. Pimp is right though, meta refresh is what is normally done and the 'better' solution for sure.

Posted: Fri Sep 02, 2005 11:33 am
by s.dot
These pages are usually intermediate pages that serves the only purpose of processing information then redirection.

Code: Select all

<html>
<head>
<title>title</title>
<meta http-equiv="refresh" content="10; url=http://www.someurl.com/">
</head>
10 would be the number of seconds to wait until redirection, the url would be the page that's being directed to