The $_server[server_name].$_server[php_self] parameter and port are not available
Write a function to get the absolute URL of the current page (possible HTTPS, port, and parameters)
function Absoluteurl () {
GLOBAL $HTTP _server_vars;
$HTTPS = $HTTP _server_vars["HTTPS"];
$HTTP _host = $HTTP _server_vars["Http_host"];
$script _url = $HTTP _server_vars["Script_url"];
$PATH _info = $HTTP _server_vars["Path_info"];
$REQUEST _uri= $HTTP _server_vars["Request_uri"];
$script _name= $HTTP _server_vars["Script_name"];
$QUERY _string= $HTTP _server_vars["Query_string"];
if (GET_MAGIC_QUOTES_GPC () ==1) $QUERY _string=stripslashes ($QUERY _string);
if ($QUERY _string!= "") $QUERY _string= "?". $QUERY _string;
$uri _http= ((strtolower ($HTTPS) = = "Off") or ($HTTPS ==0))? ' http ': ' HTTPS '). '://' . $HTTP _host;
if (Isset ($script _url))
$url = $script _url;
else if (isset ($PATH _info))
$url = $PATH _info;
else if (isset ($REQUEST _uri))
$url = $REQUEST _uri;
else if (isset ($script _name))
$url = $script _name;
$url = $uri _http. $url. $QUERY _string;
return $url;
}