PHP code:Whois - I wrote

Discussion in 'Programming' started by yuyujoke, Dec 4, 2008.

  1. #1
    <?
    function whois_request($server, $query) {
    $data = "";
    $fp = fsockopen($server, 43);
    if($fp) {
    fputs($fp, $query."rn");
    while(!feof($fp)) {
    $data .= fread($fp, 1000);
    }
    fclose($fp);
    }
    return $data;
    }
    ?>
    <FORM>
    <INPUT TYPE=HIDDEN NAME=action VALUE=query>
    Server: <INPUT TYPE=TEXT NAME=server VALUE="<?echo $server?>"> <SMALL>(ie: whois.networksolutions.com)</SMALL><BR>
    Domain: <INPUT TYPE=TEXT NAME=query VALUE="<?echo $query?>"> <SMALL>(ie: wackowoh.com)</SMALL><BR>
    <INPUT TYPE=SUBMIT VALUE=" OK ">
    </FORM>
    <?
    if($action == "query") {
    $data = whois_request($server, $query);
    echo "Sent $query to $server.<p>";
    echo "Output: <p><pre>$data</pre><p>";
    }
    ?>
     
    yuyujoke, Dec 4, 2008 IP
  2. LH-Danny

    LH-Danny Member

    Messages:
    398
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    35
    #2
    Thanks for this although I get a lot of symbols appear when I tried it.

    Heres a link: lenohost.com/whois.php
     
    LH-Danny, Dec 4, 2008 IP
  3. harrisunderwork

    harrisunderwork Well-Known Member

    Messages:
    1,005
    Likes Received:
    21
    Best Answers:
    0
    Trophy Points:
    135
    #3
    Instead of <? ?> use <?php ?> tags . That might solve your problem.

    @OP a good xhtml documents follows that u use lowercase for tagging html content. Just a suggestion :)
     
    harrisunderwork, Dec 4, 2008 IP