简介:这是判断WebSERVER类型的详细页面,介绍了和php,有关的知识、技巧、经验,和一些php源码等。
class='pingjiaF' frameborder='0' src='http://biancheng.dnbcw.info/pingjia.php?id=322825' scrolling='no'>
判断WebSERVER类型
<?PHP
function WebServerSpy($ServerURL)
{
$filepointer = fsockopen($ServerURL,80,&$errno,&$errstr);
if(!$filepointer)
{
$WebServer="Error: $errstr ($errno)<br>\n";
}
else
{
fputs($filepointer,"GET / HTTP/1.0\n\n");
while(!feof($filepointer))
{
$WebServer=fgets($filepointer,4096);
if (ereg("^Server:",$WebServer))
{
$WebServer=trim(ereg_replace("^Server:","",$WebServer));
break;
}
}
fclose($filepointer);
}
return($WebServer);
}
?>
<?PHP /**************** Example *******************/
if ($ServerURL<>"") { $WebServer=WebServerSpy($ServerURL); }
?>
<HTML>
<HEAD>
<TITLE>Ostis WebServer Spy</TITLE>
</HEAD>
<BODY>
<?PHP
if ($WebServer<>"" and $ServerURL<>"")
{
echo("<PRE>Server $ServerURL is running $WebServer.</PRE>");
}
?>
<FORM ACTION="<?PHP echo($PHP_SELF); ?>" METHOD="post">
http:// <INPUT TYPE="text" NAME="ServerURL" SIZE="40" MAXLENGTH="100">
<INPUT TYPE=hidden NAME="WebServer" VALUE="">
<INPUT TYPE=submit VALUE="Spy this Server!"><INPUT TYPE=reset VALUE="Reset">
</FORM>
</BODY>
</HTML>
“判断WebSERVER类型”的更多相关文章 》
爱J2EE关注Java迈克尔杰克逊视频站JSON在线工具
http://biancheng.dnbcw.info/php/322825.html pageNo:16