Re: Redirects in PHP

From: Date: Fri, 13 Jun 2003 17:26:32 +0000
Subject: Re: Redirects in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-151381@lists.php.net to get a copy of this message
It's like a meta tag...<meta http-equiv="Refresh" content="5;url=FILE.PHP"> JavaScript version: <script language="javascript"> function deelay(secs) { setTimeout("goto_url()",secs*1000) } function goto_url() { location.href="FILE.PHP" } </script> <body onload="deelay(2)"> "Carl Furst" <carl@vote.com> skrev i meddelandet news:JDEJLFJKOCCJDAHBKCAEMEABCDAA.carl@vote.com... > I want to do one of those redirect pages where a php script prints HTML > saying "sorry we're not here, we're redirecting you to the right location" > and then after about 2-3 seconds a new location header gets printed and you > are transported to the new location. I see this everywhere but don't know > how it's done. > > I tried this by printing the "Location" header first and then the text and > it just > relocated me without seeing the text. I tried printing the text first and > then the "Location" header and php complains that my header was already sent > and I > can't modify it to relocate. > > How do you do this?? Is there something in the header I have to specify to > wait before it relocates? Do I have to do it manually by printing the text.. > tell the script to wait and then clear the header somehow and send a new one > (can that be done?) I looked at HTTP1.1 docs and I didn't really get > anywhere. > > Any ideas? > > > Carl. > >

« previous php.general (#151381) next »