note 52827 added to function.header
| From: | php-general at lists dot php dot net | Date: | Fri, 13 May 2005 20:34:45 +0000 |
| Subject: | note 52827 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89396@lists.php.net to get a copy of this message | ||
I found this simple way to switch from http in https
if ($_SERVER['SERVER_PORT']==80) {
$newurl='https://'.$_SERVER['HTTP_HOST']
.$_SERVER['REQUEST_URI'];
header("Location: $newurl");
}
if ($_SERVER['SERVER_PORT']==443) {
$newurl='http://'.$_SERVER['HTTP_HOST']
.$_SERVER['REQUEST_URI'];
header("Location: $newurl");
}
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52827
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52827&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52827&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52827&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52827&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52827&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52827&report=yes
Search -- http://master.php.net/manage/user-notes.php