Last active
December 22, 2015 10:29
-
-
Save taomaree/6459139 to your computer and use it in GitHub Desktop.
diag.php : diagnosis http request info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<body style="font-size: smaller;"> | |
<table> | |
<tr> | |
<th>key</th> | |
<th>value</th> | |
</tr> | |
<?php | |
$var = $_SERVER; | |
// author: litao | |
//remove some server side infomation | |
unset($var['TEMP']); | |
unset($var['TMP']); | |
unset($var['PATH']); | |
unset($var['TMPDIR']); | |
unset($var['DOCUMENT_ROOT']); | |
unset($var['USER']); | |
unset($var['HOME']); | |
unset($var['PATH_TRANSLATED']); | |
unset($var['SCRIPT_FILENAME']); | |
unset($var['MIBDIRS']); | |
unset($var['MYSQL_HOME']); | |
unset($var['OPENSSL_CONF']); | |
unset($var['PHP_PEAR_SYSCONF_DIR']); | |
unset($var['PHPRC']); | |
unset($var['SystemRoot']); | |
unset($var['COMSPEC']); | |
unset($var['WINDIR']); | |
unset($var['SERVER_ADMIN']); | |
unset($var['PATHEXT']); | |
unset($var['SERVER_ADDR']); | |
unset($var['HTTP_HOST']); | |
unset($var['SERVER_SIGNATURE']); | |
unset($var['SERVER_SOFTWARE']); | |
$remote_addr_ip = explode('.', $var['REMOTE_ADDR']); | |
$var['REMOTE_ADDR'] = $remote_addr_ip[0].".".$remote_addr_ip[1].".".$remote_addr_ip[2].".*"; | |
foreach($var as $key=>$value){ echo '<tr><td>'.$key.'</td><td>'.$value." </td></tr>"; } | |
?> | |
</table> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment