这是WHOIS查找的代码。
<?
functionwhois_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>
<INPUTTYPE=HIDDENNAME=actionVALUE=query>
Server:<INPUTTYPE=TEXTNAME=serverVALUE="<?echo$server?>"><SMALL>(ie:whois.networksolutions.com)</SMALL><BR>
Domain:<INPUTTYPE=TEXTNAME=queryVALUE="<?echo$query?>"><SMALL>(ie:wackowoh.com)</SMALL><BR>
<INPUTTYPE=SUBMITVALUE="OK">
</FORM>
<?
if($action=="query"){
$data=whois_request($server,$query);
echo"Sent$queryto$server.<p>";
echo"Output:<p><pre>$data</pre><p>";
}
?>