判断WebSERVER类型
function WebServerSpy($ServerURL)
{
$filepointer = fsockopen($ServerURL,80,&$errno,&$errstr);
if(!$filepointer)
{
$WebServer="Error: $errstr ($errno)
";
}
else
{
fputs($filepointer,"GET / HTTP/1.0
");
while(!feof($filepointer))
{
$WebServer=fgets($filepointer,4096);
if (ereg("^Server:",$WebServer))
{
$WebServer=trim(ereg_replace("^Server:","",$WebServer));
break;
}
}
fclose($filepointer);
}
return($WebServer);
}
?>
if ($ServerURL<>"") { $WebServer=WebServerSpy($ServerURL); }
?>
Ostis WebServer Spy
if ($WebServer<>"" and $ServerURL<>"")
{
echo("Server $ServerURL is running $WebServer.
");
http://www.bkjia.com/PHPjc/630243.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/630243.htmlTechArticle判断WebSERVER类型 ?PHP function WebServerSpy($ServerURL) { $filepointer = fsockopen($ServerURL,80,$errno,$errstr); if(!$filepointer) { $WebServer=Error: $errstr ($errno)br; } e...