note 89306 deleted from reserved.variables.server by danbrown
| From: | danbrown@php.net | Date: | Thu, 10 Sep 2009 16:25:44 +0000 |
| Subject: | note 89306 deleted from reserved.variables.server by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-160428@lists.php.net to get a copy of this message | ||
Note Submitter: iosoft at gmail dot com
----
This is a proper way to check for SSL -
<?php
function isSSL(){
if($_SERVER['https'] == 1) /* Apache */ {
return TRUE;
} elseif ($_SERVER['https'] == 'on') /* IIS */ {
return TRUE;
} elseif ($_SERVER['SERVER_PORT'] == 443) /* others */ {
return TRUE;
} else {
return FALSE; /* just using http */
}
}
?>