note 27108 deleted from function.header by maxim
| From: | maxim@php.net | Date: | Tue, 26 Nov 2002 15:53:54 +0000 |
| Subject: | note 27108 deleted from function.header by maxim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40000@lists.php.net to get a copy of this message | ||
Hi,
I've noticed that IIS doesn't handle the header("location: blah.php"); very
nice. So I've created a little function on how to make your scripts work on both IIS/apache
Ofcourse apache will be lot faster with header ("location:")
<?php
function change_location ($whereto)
{
if (strstr($_SERVER["SERVER_SOFTWARE"],"Apache"))
{
header ("location: ".$whereto."");
}
else
{
echo "<meta http-equiv=\"refresh\"
content=\"0;url=".$whereto."\">";
}
}
?>
You can call it using change_location ("mypage.php");