Return to Snippet

Revision: 31818
at September 14, 2010 05:56 by juanrossi


Updated Code
<?
function full_url()
 	{
 $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
 $protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s;
 $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
 $address = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
 $parseUrl = parse_url(trim($address));
 return $parseUrl['scheme'].'://'.$parseUrl['host'].$parseUrl['port'].$parseUrl['path']; 
 	}
?>

Revision: 31817
at September 14, 2010 05:55 by juanrossi


Initial Code
<?
function full_url()
 	{
 $s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
 $protocol = substr(strtolower($_SERVER["SERVER_PROTOCOL"]), 0, strpos(strtolower($_SERVER["SERVER_PROTOCOL"]), "/")) . $s;
 $port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
 $address = $protocol . "://" . $_SERVER['SERVER_NAME'] . $port . $_SERVER['REQUEST_URI'];
 $parseUrl = parse_url(trim($address));
 return $parseUrl['scheme'].'://'.$parseUrl['host'].$parseUrl['path']; 
 	}
?>

Initial URL

                                

Initial Description
Based on http://snipplr.com/view/2734/get-full-url/

Initial Title
Full url without variables

Initial Tags
url, php

Initial Language
PHP