一个从别的网站抓取信息的例子(域名查询)

2015-01-24信息快讯网
<?
  if (isset($xx)) {
$dodo=@file("http://www.e9china.com/cgi-bin/comdns.pl?raw=1&lookup=OK&fqdn=".$fqdn."&domain=".$domain."&root=".$root."&cdomain=2.7");
   $i=0;
while($dodo[$i]) {
   echo $dodo[$i];
   $i++;
                   }
exit;
                 }
?>
<?
  if (isset($submit)) {
  if ($domain=="") { echo "请输入域名"; exit; }
$dom=@file("http://www.e9china.com/cgi-bin/comdns.pl?cdomain=2.7&lookup=OK&domain=".$domain."&root=".$root);
$dom1=substr("$dom[13]",19);
$dom1=chop($dom1);
    switch($dom1) {
  case "对不起!该域名已被注册</FONT>":
   for($i=0;$i<32;$i++) { #i
    echo $dom[$i];
                        }
?>
<CENTER>
<FORM METHOD=POST ACTION="<? echo $PHP_SELF; ?>">
<INPUT TYPE="hidden" NAME="fqdn" VALUE="<? echo "$domain.$root" ?>">
<INPUT TYPE="hidden" NAME="domain" VALUE="<? echo "$domain.$root" ?>">
<INPUT TYPE="hidden" NAME="root" VALUE="<? echo $root ?>">
<INPUT TYPE="submit" VALUE="显示域名注册的详细信息" name="xx">
</FORM>
</CENTER>  
<?
exit;
break;
   case "对不起!您所输入的是域名名称错误</FONT>":
   $i=0;
   while($i<42) {
   echo $dom[$i];
   $i++;
                   }
   $i=51;
   while($dom[$i])   {
   echo $dom[$i];
   $i++;
                     }
  exit;
  break;

   case "恭喜您:该域名还未被注册过,可供注册</FONT>":
?>
    <HTML>
    <HEAD>
    <TITLE>国际域名注册查询结果</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF">
<CENTER>
<TABLE BORDER=0 CELLPADDING=3 WIDTH=75%>
<TR>    
<TD>
        <TABLE BORDER=0 CELLPADDING=3 WIDTH=100%>
        <TR>
        <TD BGCOLOR="#000000">
        <FONT  COLOR=#FFFFFF SIZE=3 SIZE   
    FACE="Arial,宋体">恭喜您:该域名还未被注册过,可供注册</FONT>
        <BR>
        </TD>
        </TR>
        </TABLE>
<BR><BR>
</TD>    
</TR>
<TR>
<TD>

<BLOCKQUOTE>
<span style="font-family: Arial Black; font-size: 25pt">2</span>
<span style="font-family: 宋体; font-size: 9pt"><FONT FACE="Arial,宋体" SIZE=-1>
您所查询的国际域名<strong>"djdjdjdd.com"</strong>尚未被注册。您可以注册该域名。
</span>
    您可继续查询其它可注域名。
</FONT>
</BLOCKQUOTE>
<p>      
<p>

    <P>
    </BODY>
    </HTML>
<?
exit;
break;
                   }
                       }
?>


<form method="POST" action="<? echo $PHP_SELF; ?>">
  <input type="hidden" name="cdomain" value="2.7"><input type="hidden" name="lookup"
  value="OK"><table cellpadding="0" border="0" width="100%" cellspacing="0">
    <tr align="center">
      <td valign="middle">www. <input name="domain" size="10" maxlength="256"> <font
      size="+1"><select name="root" size="-1">
        <option value="com">.com</option>
        <option value="net">.net</option>
        <option value="org">.org</option>
      </select> </font><br>
      <br>
      <input type="submit" value="国际域名查询" name="submit"> </td>
    </tr>
  </table>
</form> 
©2014-2024 dbsqp.com