RE: [PHP] redirect using header
| From: | Matt Schroebel | Date: | Thu, 27 Mar 2003 19:24:54 +0000 |
| Subject: | RE: [PHP] redirect using header | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-141300@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: David Banning [mailto:david@skytracker.ca]
> Sent: Thursday, March 27, 2003 2:15 PM
> To: php-general@lists.php.net
> Subject: [PHP] redirect using header
>
>
> I have been trying to do a redirect with header;
>
> <HTML>
> <HEAD>
> <TITLE>Optex Staging and Services Inc. </TITLE>
> </HEAD>
> <BODY>
> <?php
> header('http://newwebpage.com');
> ?>
> <H3>
> <FONT COLOR="#3333FF">Stand By For Terminal...</FONT></H3>
>
> </BODY>
> </HTML>
If you want to send output before the re-direct you need to use
javascript.
<body
onLoad="setTimeout(location.href='http://mywebdomain.com/index.html',100
00");">
This will execute right after the page is completely loaded and move to
the next page after 10 seconds. If javascript is disabled this will not
work, so provide a link in that case to be clicked on.
You can also use the meta tag:
<meta http-equiv="refresh" content="10; URL=index.php">
<body>
Hello there
</body>
Since <meta> starts counting when page is first accessed (as opposed to
when the page is comepletly loaded), people with slow connection might
not see the message -- depending on how big things are.