note 74040 added to reserved.variables
| From: | danvasile at pentest dot ro | Date: | Wed, 21 Mar 2007 20:22:45 +0000 |
| Subject: | note 74040 added to reserved.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124683@lists.php.net to get a copy of this message | ||
If you have problems with $_SERVER['HTTPS'], especially if it returns no values at all you
should check the results of phpinfo(). It might not be listed at all.
Here is a solution to check and change, if necessary, to ssl/https that will work in all cases:
<?php
if ($_SERVER['SERVER_PORT']!=443) {
$sslport=443; //whatever your ssl port is
$url = "https://". $_SERVER['SERVER_NAME'] .
":" . $sslport . $_SERVER['REQUEST_URI'];
header("Location: $url");
}
?>
Of course, this should be done before any html tag or php echo/print.
----
Server IP: 69.147.83.197
Probable Submitter: 86.127.2.17
----
Manual Page -- http://www.php.net/manual/en/reserved.variables.php
Edit -- https://master.php.net/note/edit/74040
Del: integrated -- https://master.php.net/note/delete/74040/integrated
Del: useless -- https://master.php.net/note/delete/74040/useless
Del: bad code -- https://master.php.net/note/delete/74040/bad+code
Del: spam -- https://master.php.net/note/delete/74040/spam
Del: non-english -- https://master.php.net/note/delete/74040/non-english
Del: in docs -- https://master.php.net/note/delete/74040/in+docs
Del: other reasons-- https://master.php.net/note/delete/74040
Reject -- https://master.php.net/note/reject/74040
Search -- https://master.php.net/manage/user-notes.php