How To Find the Complete Page URL in PHP

Author: , October 25th, 2012

1 2 3 4 5 $URL   = ‘http’; if ($_SERVER["HTTPS"] == "on") {     $URL   .= "s"; }   $URL   .= ‘://’.$_SERVER[’HTTP_HOST’].$_SERVER[’REQUEST_URI’]; $URL = ‘http’; if ($_SERVER["HTTPS"] == “on”) { $URL .= “s”; } $URL .= ‘://’.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];

How To Determine HTTP Protocol Using PHP

Author: , May 11th, 2012

$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== ‘off’) ? “https:” : “http:”;