note 89306 modified in reserved.variables.server by danbrown
| From: | danbrown@php.net | Date: | Wed, 04 Mar 2009 02:52:36 +0000 |
| Subject: | note 89306 modified in reserved.variables.server by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151430@lists.php.net to get a copy of this message | ||
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 */
}
}
?>
--was--
This is a proper way to check for SSL -
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 */
}
}
http://php.net/manual/en/reserved.variables.server.php