note 79565 added to reserved.variables

From: Date: Mon, 03 Dec 2007 19:44:46 +0000
Subject: note 79565 added to reserved.variables
Groups: php.notes 
Request: Send a blank email to php-notes+get-132772@lists.php.net to get a copy of this message
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; } ?> ---- Server IP: 194.153.94.10 Probable Submitter: 84.173.225.159 ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.php Edit -- https://master.php.net/note/edit/79565 Del: integrated -- https://master.php.net/note/delete/79565/integrated Del: useless -- https://master.php.net/note/delete/79565/useless Del: bad code -- https://master.php.net/note/delete/79565/bad+code Del: spam -- https://master.php.net/note/delete/79565/spam Del: non-english -- https://master.php.net/note/delete/79565/non-english Del: in docs -- https://master.php.net/note/delete/79565/in+docs Del: other reasons-- https://master.php.net/note/delete/79565 Reject -- https://master.php.net/note/reject/79565 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#132772) next »