note 102463 added to reserved.variables.server

From: Date: Wed, 16 Feb 2011 14:26:50 +0000
Subject: note 102463 added to reserved.variables.server
Groups: php.notes 
Request: Send a blank email to php-notes+get-177030@lists.php.net to get a copy of this message
An alternative way to pudding06 at gmail dot com's suggestion to prohibit non-local visitors. <?php ($_SERVER['REMOTE_ADDR'] === $_SERVER['SERVER_ADDR']) or die(header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found")); ?> Rather than testing against 127.0.0.1, checks that the REMOTE_ADDR and the SERVER_ADDR are equal. Thus, the check will pass regardless of the IP address used in the request, but it will still restrict non-local visitors (who will be sent a 404). ---- Server IP: 69.147.83.197 Probable Submitter: 58.38.7.58 ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.server.php Edit -- https://master.php.net/note/edit/102463 Del: integrated -- https://master.php.net/note/delete/102463/integrated Del: useless -- https://master.php.net/note/delete/102463/useless Del: bad code -- https://master.php.net/note/delete/102463/bad+code Del: spam -- https://master.php.net/note/delete/102463/spam Del: non-english -- https://master.php.net/note/delete/102463/non-english Del: in docs -- https://master.php.net/note/delete/102463/in+docs Del: other reasons-- https://master.php.net/note/delete/102463 Reject -- https://master.php.net/note/reject/102463 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#177030) next »