note 27108 added to function.header

From: Date: Fri, 22 Nov 2002 23:17:07 +0000
Subject: note 27108 added to function.header
Groups: php.notes 
Request: Send a blank email to php-notes+get-39882@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"); -- http://www.php.net/manual/en/function.header.php http://master.php.net/manage/user-notes.php?action=edit+27108 http://master.php.net/manage/user-notes.php?action=delete+27108 http://master.php.net/manage/user-notes.php?action=reject+27108

« previous php.notes (#39882) next »