Version: 0.8
Type: Full Script
Category: Networking
License: GNU General Public License
Description: The scripts connects to a given web server and retrieves information about it.
<?php //just a simple script togive you an ideea abou what PHP can do function ServerInfo($ServerURL) { $server = fsockopen($ServerURL,80,&$errno,&$errstr); if(!$server) { $WebServer= "Error: $errstr ($errno)<br>"; } else { fputs($server, "GET / HTTP/1.0nn"); while(!feof($server)) { $WebServer=fgets($server,4096); if (ereg( "^Server:",$WebServer)) { $WebServer=trim(ereg_replace( "^Server:", "",$WebServer)); break; } } fclose($filepointer); } return($WebServer); } if ($ServerURL<> "") { $WebServer=ServerInfo($ServerURL); } ?><HTML> <HEAD> <TITLE>Server Info</TITLE> </HEAD> <BODY bgcolor=#c0c0c0 > <?PHP back(); if ($WebServer <> "" and $ServerURL <> "") { echo( "<font color=darkblue size=4><b><PRE>Server $ServerURL is running $WebServer.</PRE></font>"); } ?> <br><br> <FORM ACTION=" <?php echo($PHP_SELF); ?>" METHOD="post"> <font color="darkblue"><b>http://</b></font><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>