function get_location () {
global $PHP_SELF, $SERVER_NAME, $HTTP_HOST, $SERVER_PORT,
function get_location () {
global $PHP_SELF, $SERVER_NAME, $HTTP_HOST, $SERVER_PORT,
/* Get the path, handle virtual directories */
$path = substr(php_self(), 0, strrpos(php_self(), '/'));
/* Get the path, handle virtual directories */
$path = substr(php_self(), 0, strrpos(php_self(), '/'));
/* Fallback is to omit the server name and use a relative */
/* URI, although this is not RFC 2616 compliant. */
return ($host ? $proto . $host . $port . $path : $path);
/* Fallback is to omit the server name and use a relative */
/* URI, although this is not RFC 2616 compliant. */
return ($host ? $proto . $host . $port . $path : $path);