RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page
| From: | Dan Joseph | Date: | Tue, 13 Jul 2004 19:03:41 +0000 |
| Subject: | RE: [PHP] Detecting if browser is using a HTTP or HTTPS connection to view the page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-190376@lists.php.net to get a copy of this message | ||
Hi,
if ($_SERVER["HTTPS"] != "on") {
$newurl = "https://" . $_SERVER["SERVER_NAME"] .
$_SERVER["REQUEST_URI"];
header("location: $newurl");
die;
}
That's how I do it..
-Dan Joseph
> Is there a way to detect if a browser is using a HTTPS or
> HTTP. As i can get the scripts self and the host its running
> off but i cannot seem to find a way to grab if the connection
> is secure or not.