|
|
|
| Title : |
WebServerSpy checks which kind of Webserver is running, Apache, Netscape, Fasttrack, IIS, HTTP-Header, HTTP 1.0, GET, spy, WWW |
| Categories : |
HTTP, Network, Apache, PHP, Web Servers |
 Bernhard Ostheimer |
| Date : |
Jul 14th 1999 |
| Grade : |
2 of 5 (graded 9 times) |
| Viewed : |
9804 |
| File : |
No file for this code example. |
| Images : |
No Images for this code example. |
|
| Search : |
More code by Bernhard Ostheimer |
|
| Action : |
Grade This Code Example
|
|
| Tools : |
My Examples List |
|
|
|
|
|
|
<?PHP
/*
* Function WebServerSpy created to check, which kind of WebServer is
* running (e.g. NS Fasttrack, Apache etc.).
*
* (c) 1999 by: Bernhard Ostheimer (bernhard.ostheimer@uni-mainz.de)
*
* View Example @ http://service.wiwi.uni-mainz.de/~ostheimer/php/webserverspy/
*
* Permission to use and modify this software and its
* documentation for any purpose other than its incorporation
* into a commercial product is hereby granted without fee,
* as long as the author is notified that this piece of software
* is being used in other applications.
* Permission to copy and distribute this software and its
* documentation only for non-commercial use is also granted
* without fee, provided, however, that the above copyright
* notice appear in all copies, that both that copyright notice
* and this permission notice appear in supporting documentation.
* The author makes no representations about the suitability
* of this software for any purpose. It is provided ''as is'',
* without express or implied warranty.
*/
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> |
|
| Caldera Openlinux 1.2 Standard Categories : Web Servers, MySQL, PHP, Apache, Databases | | | apache_lookup_uri -- Perform a partial request for the specified URI and return all info about it Categories : PHP, PHP Functions, Apache, Web Servers | | | How do you specify the default document in Apache?
Categories : Apache, HTTP, Web Servers | | | include php3 files Categories : Filesystem, PHP, Apache, Web Servers | | | Easy windows installation kit for win 9* PHP4 MySQL Apache phpMyAdmin Categories : Installation, PHP, MySQL, Apache, Web Servers | | | PHP Apache and SSL Categories : PHP, Apache, Web Servers | | | Logging 404 errors in your custom statistics using Apache and a PHP script. Categories : Apache, Web Servers, PHP, Errors and Logging | | | Why do i get a "Save As" dialog box when I type in the url of a php3 file Categories : PHP Configuration, PHP, Apache, Web Servers | | | redirect redirection ip address authentication authenticate addr Categories : Authentication, HTTP, Network, PHP | | | The first step Guest Book ... ^^ Categories : MySQL, PHP, Apache, HTML, HTTP | | | gd libraries make gmake php3 apache-1.3.0 gd1.3 FreeBSD-2.2
Categories : Installation, PHP, Apache, Web Servers | | | PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | phpCMS a content-management-system written in php. Categories : Content Management, Apache, Complete Programs, Web Servers, PHP | | | IP Blocking Categories : PHP, Security, HTTP | | | Identify and log search engine access (spiders, robots, etc.) to a page. Categories : HTTP, Environment Variables, PHP, MySQL, Databases | |
|
|