note 112480 deleted from reserved.variables.server by levim
| From: | levim@php.net | Date: | Wed, 04 Sep 2013 22:49:40 +0000 |
| Subject: | note 112480 deleted from reserved.variables.server by levim | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196164@lists.php.net to get a copy of this message | ||
Note Submitter: programings at abv dot bg
----
I found a very simple and crafty way to protect some information in your web page using protection
by header with $_SERVER['HTTP_USER_AGENT'].
<?php
$password = "dog";
if($_SERVER['HTTP_USER_AGENT']==$password) {
echo "Access Granted";
} else {
echo "Some default info";
}
?>
Now you can change your User-Agent header with LiveHTTPHeader (addon for Mozilla Firefox that
capture HTTP headers) for example, and the secret info will be shown in the page.