Server software - remote find out what it is

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Krustov

    #1

    Server software - remote find out what it is



    Just did the above - but its not ideal as it requires a user to do a
    html cut-n-paste and save before uploading to their webspace .

    Like (e.g.) netcraft i'd like to have a form box where a user can type
    in the url of their own website to find out if they have suitable
    windows web hosting or not .

    (its not a easy thing to search for on google as finding the right the
    right words to type into google isnt easy in some cases)
  • Krustov

    #2
    Re: Server software - remote find out what it is

    <comp.lang.ph p>
    <Krustov>
    <Fri, 27 Oct 2006 20:32:33 +0100>
    <MPG.1fac6f1dc3 4e955b98a11e@ne ws.newsreader.c om>
    Like (e.g.) netcraft i'd like to have a form box where a user can type
    in the url of their own website to find out if they have suitable
    windows web hosting or not .
    >
    Got it - and quite a little mutha to solve for somebody who hasnt got
    around to learning the likes of fopen etc .



    <?php

    $domain="www.ex ample.com";

    $fp=fsockopen($ domain,80,$errn o,$errstr,30);

    if (!$fp) {print "$errstr ($errno)<br>\n" ;}

    else

    {
    $gt="";
    $out = "HEAD / HTTP/1.1\r\n";
    $out .= "Host: $domain\r\n";
    $out .= "Connection : Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {$gt=$gt . fgets($fp, 128);}
    fclose($fp);
    }

    $chevy=strtolow er($gt);

    $passurl=0;

    $wurd="server: microsoft";
    $yesno=strpos($ chevy,$wurd); if ($yesno==true) {$passurl=1;}

    $wurd="server: apache";
    $yesno=strpos($ chevy,$wurd); if ($yesno==true) {$passurl=2;}

    if ($passurl==0) {print "<br><br>"; print "PROBLEM CHECKING THE DOMAIN -
    UNKNOWN";}

    if ($passurl==1) {print "<br><br>"; print "YES - YOU HAVE SUITABLE
    WEBSPACE";}

    if ($passurl==2) {print "<br><br>"; print "NO - YOU DONT HAVE SUITABLE
    WEBSPACE";}

    ?>

    Comment

    Working...