Home > Backend Development > PHP Tutorial > 判断WebSERVER类型_PHP

判断WebSERVER类型_PHP

WBOY
Release: 2016-06-01 12:32:56
Original
833 people have browsed it

WebServer

判断WebSERVER类型


function WebServerSpy($ServerURL)  
{
  $filepointer = fsockopen($ServerURL,80,&$errno,&$errstr);
  if(!$filepointer)  
  {
    $WebServer="Error: $errstr ($errno)
\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);
}
?>
if ($ServerURL"") { $WebServer=WebServerSpy($ServerURL); }
?>


Ostis WebServer Spy


if ($WebServer"" and $ServerURL"")  
{
  echo("
Server $ServerURL is running $WebServer.
Copy after login
");
}
?>


  http://
  
  



Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template