Recently in the PHP program, you need to make the browser between HTTPS and HTTP conversion, Internet search related information, but only recently in the PHP program, need to make the browser between HTTPS and HTTP conversion, Internet search related information, but only one introduction with ASP implementation " "Between HTTP and https" article, so had to write the PHP implementation of HTTP and HTTPS conversion code.
If the Web page uses HTTPS access, add the following code at the beginning of the page:
View Plainprint?
HTTP conversion to HTTPS
if ($_server["HTTPS"]<> "on")
{
$xredir = "https://". $_server["SERVER_NAME"].
$_server["Request_uri"];
Header ("Location:". $xredir);
}
?>
If the Web page uses HTTP access, add the following code at the beginning of the page:
View Plainprint?
HTTPS conversion to HTTP
if ($_server["HTTPS"]== "on")
{
$xredir = "http://". $_server["SERVER_NAME"].
$_server["Request_uri"];
Header ("Location:". $xredir);
}
?>
http://www.bkjia.com/PHPjc/478700.html www.bkjia.com true http://www.bkjia.com/PHPjc/478700.html techarticle recently in the PHP program, you need to make the browser between HTTPS and HTTP conversion, Internet search related information, but only recently in writing PHP program, need to make the browser between HTTPS and HTTP ...