<?
header("content-type:text/html; charset=gb2312");
$do=$_POST["query"];
$do=trim($do);
$do=strtolower($do);
$url="http://www.baidu.com/word=$do";
$a=file_get_contents($url);
$arr=explode("<msg>",$a);
$arr=explode("</msg>",$arr[1]);
$s=$arr[0];
if (strpos($s,"找到"))
{
$s=str_replace("恭喜!","",$s);
exit("<div id='do' style='color:#F1AB41'>$s <a href='javascript:me(\"".trim(str_replace("恭喜恭喜找到","",$s))."\");'>收藏</a></div>");
}
if (strpos($s,"有误"))
{
exit("<div id='do' style='color:#FF0000'>".$s."或查询出错 <a onclick='this.parentNode.style.display=\"none\"' href='javascript:requery(\"".trim(str_replace("输入有误","",$s))."\");'>重新查询</a></div>");
}
echo "<div id='do'>$s";
$name=trim(str_replace("155","",$s));
if (strpos($s,"155"))
echo " <a href=\"javascript:whois('$name','".str_replace(".","",$name)."');\">Whois信息</a><div id=".str_replace(".","",$name)." style='display:none;width:400px;'>Loading...</div>";
echo "</div>";
?>
能把他转换成ASP.net吗?主要是这几句$do=$_POST["query"];
$do=trim($do);
$do=strtolower($do);
$url="http://www.baidu.com/word=$do";
$a=file_get_contents($url);
$arr=explode("<msg>",$a);
$arr=explode("</msg>",$arr[1]);
$s=$arr[0];
if (strpos($s,"找到"))
{
$s=str_replace("恭喜!","",$s);
header("content-type:text/html; charset=gb2312");
$do=$_POST["query"];
$do=trim($do);
$do=strtolower($do);
$url="http://www.baidu.com/word=$do";
$a=file_get_contents($url);
$arr=explode("<msg>",$a);
$arr=explode("</msg>",$arr[1]);
$s=$arr[0];
if (strpos($s,"找到"))
{
$s=str_replace("恭喜!","",$s);
exit("<div id='do' style='color:#F1AB41'>$s <a href='javascript:me(\"".trim(str_replace("恭喜恭喜找到","",$s))."\");'>收藏</a></div>");
}
if (strpos($s,"有误"))
{
exit("<div id='do' style='color:#FF0000'>".$s."或查询出错 <a onclick='this.parentNode.style.display=\"none\"' href='javascript:requery(\"".trim(str_replace("输入有误","",$s))."\");'>重新查询</a></div>");
}
echo "<div id='do'>$s";
$name=trim(str_replace("155","",$s));
if (strpos($s,"155"))
echo " <a href=\"javascript:whois('$name','".str_replace(".","",$name)."');\">Whois信息</a><div id=".str_replace(".","",$name)." style='display:none;width:400px;'>Loading...</div>";
echo "</div>";
?>
能把他转换成ASP.net吗?主要是这几句$do=$_POST["query"];
$do=trim($do);
$do=strtolower($do);
$url="http://www.baidu.com/word=$do";
$a=file_get_contents($url);
$arr=explode("<msg>",$a);
$arr=explode("</msg>",$arr[1]);
$s=$arr[0];
if (strpos($s,"找到"))
{
$s=str_replace("恭喜!","",$s);
$do=trim($do); // 去掉$do首尾的白字符
$do=strtolower($do); // 将$do改为全小写
$url="http://www.baidu.com/word=$do"; // 构造一个搜索地址
$a=file_get_contents($url); // 抓取远程页面,返回字符串
$arr=explode("<msg>",$a); // 将取回的字符串按<msg>分割为数组
$arr=explode("</msg>",$arr[1]); // 将上一步分割得到的第二个成员按</msg>分割为数组
$s=$arr[0]; // 取第二步分割得到的数组的第一个成员
if (strpos($s,"找到")) // 在最后得到的字符串中检查时候存在 “找到”
{
$s=str_replace("恭喜!","",$s);