note 79565 deleted from reserved.variables by felipe

[email protected]
Newsgroups php.notes
Message-ID <[email protected]>
Note Submitter: Christian J. Kiewiet 

----

The get_url() function below a bit smaller and a slight bit improved, yet much uglier.

<?php

function get_url($show_port = false)
{
    $protocol = ($_SERVER['HTTPS']) ? 'https://' : 'http://';
    $host = $_SERVER['HTTP_HOST'];
    $port = ($show_port || $_SERVER['SERVER_PORT']!=80) ? ":{$_SERVER['SERVER_PORT']}" : '';
    $file = $_SERVER['SCRIPT_NAME'];
    $query = ($_SERVER['QUERY_STRING']) ? "?{$_SERVER['QUERY_STRING']}";
    return $protocol.$host.$port.$file.$query;
}

?>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.