设为首页 收藏本站
查看: 843|回复: 0

[经验分享] php查询多个门户网站页面搜索结果简单代码

[复制链接]
累计签到:1 天
连续签到:1 天
发表于 2014-11-7 08:45:55 | 显示全部楼层 |阅读模式
在门户网站搜索信息的功能.
site.php
main.php
left.php
search.php
common/function.php
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
site.php
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link href="./css/style.css" rel="stylesheet">
<title>全国最全最大的搜索引擎</title>
</head>
<script language="javascript">
function check(){
        if(myform.keyword.value==""){
                alert("请输入查询关键字!");myform.keyword.focus();return false;
        }
}
</script>
<body>
<br><br><br><br>
<br>
<br>
<br><br><br>
<a href="./" target="_self"><img src="images/kuaikuaisou.gif" border="0" width="216" height="137"></a><br>
<br>
<table width="592" border="0" cellspacing="0" cellpadding="0" height="16">
<tr align="center">
<td width="592" height="9">
<table width="600" border="0" cellspacing="0" cellpadding="0" height="23">
<tr align="center">
<td width="49" class="su1" id="su99s1"><a href="./index.php" target="_self">站内</a></td>
<td width="1"></td><td width="49" class="su0" id="su99s2" onClick="so99su(1)"><a href="./site.php" target="_self">网页</a></td>
<td width="1"></td><td width="49" class="su1" id="su99s3">音乐</td>
<td width="1"></td><td width="49" class="su1" id="su99s4">铃声</td>
<td width="1"></td><td width="49" class="su1" id="su99s5">图片</td>
<td width="1"></td><td width="49" class="su1" id="su99s6">电影</td>
<td width="1"></td><td width="52" class="su1" id="su99s7">新闻</td>
<td width="1"></td><td width="52" class="su1" id="su99s8">B T</td>         
<td width="1"></td><td width="52" class="su1" id="su99s9">论坛</td>
<td width="1"></td><td width="49" class="su1"id="su99s10">图书</td>
<td width="1"></td><td width="49" class="su1"id="su99s11">更多</td>
<td width="1"></td></tr></table>
</td>           
</tr>
<form name="s" method="get" action="main.php" target="_self">
<tr align="center">
<td height="96" background="images/bg2.gif" style="border: 1 solid #0882E9">
  <p align="center">
        <input type="hidden"  name="shq" value="84">
    <input name="keyword" type="text"  id="keyword" size="60" maxlength="100"  onMouseOver="this.focus()" class="txt"/>&nbsp;
    <input name="submit" type="submit"  value="codego.net 互联网搜索" class="btn">
  </p>
<p align="center"><font color="#008000">
   <input type="radio"  value="baidu" name="xm" class="tb1" checked><a href="http://www.baidu.com" target="_blank">百度</a>&nbsp;
   <input type="radio" value="google" name="xm" class="tb1"> <a href="http://www.google.com" target="_blank">Google</a>&nbsp;
   <input type="radio" value="msn" name="xm" class="tb1"> <a href="http://www.msn.com" target="_blank">MSN中国</a>&nbsp;
   <input type="radio" value="zhongsou" name="xm" class="tb1"><a href="http://www.zhongsou.com" target="_blank">中搜</a>&nbsp;
   <input type="radio" value="sogou" name="xm" class="tb1"><a href="http://www.sogou.com" target="_blank">搜狗</a>&nbsp;
   <input type="radio" value="tianw" name="xm" class="tb1"><a href="http://www.tianwang.com" target="_blank">天网</a>&nbsp;
   <input type="radio" value="iask" name="xm" class="tb1"> <a href="http://www.iask.com" target="_blank">爱问</a>&nbsp;
   <input type="radio" value="yahoo" name="xm" class="tb1"><a href="http://www.yahoo.com.cn" target="_blank">雅虎</a>&nbsp;
   <input type="radio" value="17sou" name="xm" class="tb1"><a href="http://www.17so.com" target="_blank"> 一起搜</a>&nbsp;
   </font></p>                       
</td>                                                         
</tr>
</form>
</table>
<p><a href="./manage/admin/login.php">&nbsp;</a><a href="http://www.mrbccd.com">编程词典</a>&nbsp;|&nbsp;<a onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.mrbccd.com')" href="http://www.mrbccd.com">把快快搜设为首页</a>&nbsp;|&nbsp;&lt;a href="http://www.mrbccd.com">关于快快搜</a></p>
<p><span class="STYLE1">Copyright&nbsp;&copy;&nbsp;快快搜主站 www.mrbccd.com All Rights Reserved!</span><span class="STYLE1">&nbsp;吉ICP备 122345678</span></p>
<p>
<script>function so99su(n){
var KeyNo=Math.floor(6*Math.random());
for(i=1;i<12;i++){
        eval("document.getElementById('su99s"+i+"').className='su1'");
}
        eval("document.getElementById('su99s"+n+"').className='su0'");
if(n==1){s.shq.value="zn";}
else if(n==2){s.shq.value="wy";}
else if(n==3){s.shq.value="yy";}
else if(n==4){s.shq.value="ls";}
else if(n==5){s.shq.value="tp";}
else if(n==6){s.shq.value="dy";}
else if(n==7){s.shq.value="new";}
else if(n==8){s.shq.value="bt";}
else if(n==9){s.shq.value="bbs";}
else if(n==10){s.shq.value="book";}
else if(n==11){s.shq.value="more";}
}
</script>
</p>
</body>
</html>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
left.php
<?php
$keyword =$_GET['keyword'];
$xm=$_GET['xm'];
$keyword2=urlEncode($keyword);
$keyword3=strtolower($keyword2);
if($keyword =="")
{echo "你没有输入条件啊!!";
exit;}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<link  href="./css/style.css" rel="stylesheet" type="text/css">
<style>
body  {text-align: left;}
.t1{ color: #FFFF00;font-family: Webdings;}
.t2{ color: #9999FF;font-family: Webdings;}
.parent{width:100%; height: 20; letter-spacing: 2; vertical-align: 0; font-weight: bold; background-color: #66CCFF; border-bottom-style: solid; border-bottom-width: 1}
</style>
<base target="cjss">
</head>
<BODY>
<?php print <<<EOT
<script>if(top==self)top.location="main.php?keyword=$keyword";</script>
<form action="main.php" method="get" target="_top">
        <table border="0" cellpadding="2" cellspacing="0" bgcolor="#47AFF" width="100%">
      <tr>
        <td width="100%" align="center"><a href="./" target="_top"><img  src="images/kuaikuaisou.gif" border="0" width="120" height="68"></a><br>
          <br>&nbsp;<input name="keyword" value="$keyword" size="15" >
                  </td>
      </tr>
      <tr>
        <td width="100%"  height="35" align="center">
           &nbsp;<input type="submit" value="极速搜索" class="btn">
        </td>
      </tr> </FORM>
          
  </table>&nbsp;
<!--网页标题-->
<div class='parent' ><font class="t1">8</font>&nbsp;网页</div>
<!--下面是常用的大型搜索引擎-->
<div style="width: 134; height: 128;">&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://www.baidu.com/s?tn=aiyat&ct=&lm=&z=&rn=&_sv=1&word=$keyword2">百度</a>
<br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://www.google.com/search?hl=zh-CN&newwindow=1&q=$keyword2">GOOGLE</a>
<br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://cnweb.search.live.com/results.aspx?q=$keyword2&page=searchresults&FORM=MSNH&where1=&mkt=zh-cn">MSN中国</a>
<br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://page.zhongsou.com/p?aid=E0200000000&k=tlei&w=$keyword2">中搜</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://www.sogou.com/websearch/corp/search.jsp?query=$keyword2&amp;searchtype=1&pid=aiyatx&class=1&cpc=SOGOU">搜狗</a&gt;<br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://www.tianwang.com/cgi-bin/tw?word=$keyword2&range=0&amp;cd=03&submit.x=14&submit.y=7">天网</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://iask.sina.com.cn/search_engine/search_knowledge_engine.php?key=$keyword2&classid=0&title=PHP&amp;gjss=0&x=27&y=13">爱问</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://search.union.yahoo.com.cn/click/search.htm?fw=union&m=82676&b=1003&p=1009&a=2001&name=$keyword2">雅虎</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://www.17so.com/so?q=$keyword2">一起搜</a>
</div>
<!--音乐歌词-->
<div class='parent'><font  class="t1">8</font>&nbsp;音乐歌词</div>
<!--下面是常用的歌词网站-->
<div style="width: 114; height: 140">&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://music.qq.com/portal_v2/static/search_result.html?search_input=$keyword2&search_bt.x=33&search_bt.y=11">QQ音乐</a><br> &nbsp;<font class="t2">4</font>&nbsp;
<a href="http://mp3.baidu.com/m?tn=baidump3&ct=134217728&lm=-1&z=&rn=&_sv=4&word=$keyword2&_si.x=15&_si.y=9">百度MP3</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://music.yahoo.com.cn/search?p=$keyword2&pid=82676_1006&amp;needbid=&ei=GBK&source=3721_union">雅虎MP3</a><br&gt;&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://mp3.zhongsou.com/m?w=$keyword2&ty=&lg=">中搜 MP3</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://d.sogou.com/music?query=$keyword2&searchtype=4&pid=aiyatx&class=1&cpc=SOGOU">搜狗MP3</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://m.iask.com/g?k=$keyword2&ss=all">爱问MP3</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://mp3.baidu.com/m?f=ms&tn=baidump3lyric&ct=150994944&amp;lf=1&rn=10&word=$keyword2&lm=-1">百度歌词 </a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://music.yahoo.com.cn/lyric.html?pid=82676_1006&p=$keyword2&button=$keyword2&button=%B8%E8%B4%CA%CB%D1%CB% F7&mimetype=all&source=ysearch_music_result_topsearch">雅虎歌词&lt;/a>
</div>
<!--电影网站-->codego.net/tags/4/1/
<div class='parent'><font  class="t1">8</font>&nbsp;电影</div>
<!--下面是常用的电影网站-->
<div class='child'  style="width: 116; height: 58">&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://movie.baidu.com/srh.php?tn=baidux&word=$keyword2">百度影视</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://video.search.yahoo.com/search/video?p=$keyword2&toggle=1&ei=GBK">雅虎 Video</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://v.iask.com/v?k=$keyword2">爱问视频</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://file.tianwang.com/cgi-bin/search?word=$keyword2&FType=3&submit.x=31&submit.y=12">天网影视</a>
</div>
<!--软件源码-->
<div class='parent'><font  class="t1">8</font>&nbsp;软件源码&nbsp;</div>
<!--下面是常用的软件源码网站-->
<div class='child' style="width: 131; height: 88">&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://search2.onlinedown.net/search.asp?keyword=$keyword2">华军软件园</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://www.skycn.com/search.php?offset=0&ss_name=$keyword2"&gt;天空软件</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://down.chinaz.com/query.asp?action=title&keyword=$keyword2&page=1">中国站长站</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://dlc.pconline.com.cn/search.jsp?keyword=$keyword2">太平洋软件</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://soft.sogou.com/software.so?query=$keyword2&amp;class=4">搜狗下载</a></div>
<!--论坛网站-->
<div  class='parent'><a name="bbs"></a><font  class="t1">8</font>&nbsp;论坛</div>
<!--下面是一些大型的论坛-->
<div  class='child'  style="width: 130; height: 70">&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://post.baidu.com/f?kw=$keyword2">百度贴吧</a><br>&amp;nbsp;<font class="t2">4</font>&nbsp;
<a href="http://search.bbs.sina.com.cn/search/search?gid=3&bbsid=19&amp;t=keyword&q=$keyword2">新浪说吧</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://search.chinabbs.com/cgi-bin/search?content=$keyword2&type=title">Chinabbs</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://bbs.zhongsou.com/b?w=$keyword2&dt=1&webid=tlei&aid=B0100006149">中搜论坛</a></div>
<!--新闻网站-->
<div class='parent'><font  class="t1">8</font>&nbsp;新闻</div>
<!--下面是一些知名的新闻网站-->
<div class='child'  style="width: 131; height: 120">&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://news.baidu.com/ns?tn=news&ct=201326592&lm=-1&z=0&rn=&_sv=2&word=$keyword2&_si.x=12&_si.y=5">百度新闻</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://xinwen.yahoo.com.cn/search?p=$keyword2&pid=82676_1006&amp;needbid=&ei=GBK&source=3721_union">雅虎新闻</a><br&gt;&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://iask.com/n?k=$keyword2">新浪新闻</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://news.sogou.com/news?query=$keyword2&searchtype=5&pid=aiyatx&class=1&cpc=SOGOU">搜狗新闻</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://search.xinhuanet.com/search/searchnews.jsp?sw=$keyword2"&gt;新华网新闻</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://news.zhongsou.com/zsnews.cgi?word=$keyword2&hcsource=&amp;selectact=&class1=">中搜新闻</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://news.google.com/news?hl=zh-CN&ned=cn&ie=UTF-8&q=$keyword2">GOOGLE新闻</a></div>
<!--图片资源网站-->
<div class='parent'><font class="t1">8</font>&nbsp;图片</div>
<div id='KB8Child' class='child' style="width: 157; height:  22">&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://image.baidu.com/i?tn=baiduimage&ct=201326592&lm=- 1&z=0&rn=&_sv=6&word=$keyword2&_si.x=15&_si.y=11">百度图片</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://image.yahoo.com.cn/search?p=$keyword2&pid=82676_1006&amp;needbid=&ei=GBK&source=3721_union">雅虎图片</a><br&gt;&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://images.google.com/images?q=$keyword2&amp;hl=zh-CN">Google图片</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://img.zhongsou.com/i?w=$keyword2&amp;t=&amp;l=">中搜图片</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a  href="http://image.sogou.com/imgsearch.jsp?keyword=$keyword2&amp;sogouhome="> 搜狗图片</a><br>&nbsp;<font class="t2">4</font>&nbsp;
<a href="http://p.iask.com/p?k=$keyword2">爱问图片</a>  </div>  
</BODY>  
</HTML>
<!--
EOT;
?>-->

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
search.php
<html>
<link rel="stylesheet" href="./css/style.css" />
<style type="text/css">
<!--
.STYLE13 {color: #FF3399}
.STYLE16 {color: #FF0000}
.STYLE20 {color: #0066FF}
.STYLE21 {color: #006600}
-->
</style>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="96%" align="left">
        <?php require_once("top.php");?>
        </td>
  </tr>
</table>
<?
require("splitword.php");
require("common/function.php");
if($_GET){
$keyword=$_GET[keyword];
}
if($submit2!=""){                                                //???é???á?????é??
        $h_keyword=$hide_keyword;                        //????????????       
        $keynew=$keyword;
        $h_keyword.=$keyword;                                //????????+????
        $keyword=$h_keyword;                                //??×???????????keyword
}
$yuan=trim($keyword);
$tt= $yuan;
$str=gl($tt);
$sp = new SplitWord();
//·????è?????????±????·???????????·??????·
$time_start = getmicrotime();
$sp->SplitRMM($str);
$tt=$sp->SplitRMM($str);
?>
<?php
        require_once("./common/db_mysql.class.php");
        $DB = new DB_MySQL;                                //???¨???ó
        $str=array(" ","");                                //?¨????????×é
        $cc=str_replace($str,"",$tt);        //????×?·???????????
        if(substr($cc,0,2)=="??"){
                $cc= substr($cc,2);                        //?????°?????°???±·???
        }
        if(substr($cc,-2,2)=="??"){
                $cc= substr($cc,0,-2);                //?????ó?????°???±·???
        }
       
        if(substr($cc,0,2)=="??" && substr($cc,-2,2)=="??"){
                $a= substr($cc,2);                        //?????°?????°???±·???
                $cc= substr($a,0,-2);                //?????ó?????°???±·???
        }
                $newstr = explode("??",$cc);                        //????explode()??????×?·???×???????×é
                if(count($newstr)==1){                                        //??????×é????????????1?????ò°??????????????é??
                         $sql = "select * from tb_info where title like '%".$newstr[0]."%' or content like '%".$newstr[0]."%'order by id desc ";
                }else{
                        if($submit2!=""){                                        //???é???á?????é??
                                //?????é??·???
                                $keynew=gl($keynew);                        //????±ê??·???
                                $sp1 = new SplitWord();
                                $sp1->SplitRMM($keynew);
                                $tc=$sp1->SplitRMM($keynew);
                                        $cc1=dunhao($tc);
                                        $newstr1 = explode("??",$cc1);                //????explode()??????×?·???×???????×é
                                /***************************************************************************************/
                                //?????é??????·¨
                                $k_sql="select k_id from tb_temp";
                                $info = $DB->fetch_one_array($k_sql);
                                $kid=substr($info['k_id'],0,-1);                                //????×??ó?????°@?±
                                $k_id=explode('@',$kid);                                                //??ID??×???????×é
                                $sql = "select * from tb_info ";                                //?é??????±í????????
                                while(list($name,$value)=each($k_id)){                        //±é?ú??×é
                                   $a.="$value".",";
                                }
                                $a= substr($a,0,-1);                                                        //????×??ó?????°,?±·???
                                //????in???ü×??é???ù??ID????????????
                                $sql .= " where id in(".$a.") ";                                //???¨?à????????       
                                               
                                $sql2=" and (";
                                for($i=0;$i<count($newstr1);$i++){
                                        $sql0.=" title like '%".trim($newstr1[$i])."%'"." or";       
                                }
                                for($j=0;$j<count($newstr1);$j++){
                                        $sql1.=" content like '%".trim($newstr1[$j])."%'"." and";       
                                }
                                $sql1=substr($sql1,0,-3);                                                //????×??ó?????°and?±
                                $sql3=")";
                                $sql.=$sql2.$sql0.$sql1.$sql3. " order by id desc";
                        }
               
                        else{
                        //?????é???á????
                        for($i=0;$i<count($newstr);$i++){
                                $sql0.=" title like '%".trim($newstr[$i])."%'"." or";       
                        }
                        for($j=0;$j<count($newstr);$j++){
                                $sql1.=" content like '%".trim($newstr[$j])."%'"." or";       
                        }
                        $sql1=substr($sql1,0,-3);                                //????×??ó?????°or?±               
                        $sql="select * from tb_info where".$sql0.$sql1." order by id desc";
                        }
        }       
       
        if($_GET){
                //???????á????????
                $page_num = $_GET['page_num']? $_GET['page_num']: 1;
        }
        else{
                //?×???????±,??????1
                $page_num = 1;
        }
        //????×???????
        $DB->query($sql);
        $row_count_sum = $DB->get_rows();
        $row_count_sum;
        //??????????,???????????????ò???±?????¨??
        $row_per_page = 6;
        //×?????
        $page_count = ceil($row_count_sum/$row_per_page);
        //??????·??????????ò??×??ó????
        $is_first = (1 == $page_num) ? 1 : 0;
        $is_last = ($page_num == $page_count) ? 1 : 0;
        //?é????????????
        $start_row = ($page_num-1) * $row_per_page;
        //??SQL?????í??limit×???
        $sql .= " limit $start_row,$row_per_page";
        //?????é??
        $DB->query($sql);
        $res = $DB->get_rows_array();
        //?á????????
        $rows_count=count($res);
        $time_end = getmicrotime();                                //?á?????±
        $t0 = $time_end - $time_start;                        //???÷???±
        ?>
<TABLE cellSpacing=1 cellPadding=0 width="100%" bgColor=#e5ecf9  style="BORDER-RIGHT: #dddddd 1px solid; BORDER-TOP: #ffffff  1px solid; BORDER-LEFT: #ffffff 1px solid; BORDER-BOTTOM: #dddddd 1px solid">
  <tr>
    <td width="62%" border=1 >&nbsp;?ú?é???????ü×?????<?php echo $keyword;?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo "·???:  "; foreach( $newstr as $link) { ?> <a href="so.php?keyword=<?php echo urlencode($link); ?>"><?php echo $link." ";} ?></a></td>
    <td width="22%" border=1 >?ì?ì?????????à??????????&nbsp;<font  color="#AA0066"><?php echo $row_count_sum;?></font>&nbsp;????</td>
    <td width="16%" border=1 ><?php echo "???±?? $t0 ??";?></td>
  </tr>
</table>
<table width=100% height="600" border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td valign="top"><br /><p>
        <?php
                for($i=0;$i<$rows_count;$i++){
                        $id=$res[$i]['id'];                        //ID??
                        $title=$res[$i]['title'];        //±ê??
                        $content = $res[$i]['content'];        //????
                ?>
      </p>
      <table width="831" border="0" cellpadding="0" cellspacing="0" style="margin-left:15px; margin-right:15px">
        <tr>
          <td width="831" height="23" class="alink">&nbsp;&nbsp;&nbsp;&nbsp;
                  <a href="lookinfo.php?id=<?php echo $id; ?>" target="_blank">
                  <?php
                         for($n=0;$n<count($newstr);$n++){
                                 $title= str_ireplace($newstr[$n],"<font color='#FF0000'>".$newstr[$n]."</font>",$title);
                        }
                   echo chinesesubstr($title,0,80);
                   if(strlen($title)>80){ echo "...";}
                  ?>
                  </a></td>
        </tr>
        <tr >
          <td >&nbsp;&nbsp;&nbsp;&nbsp;
            <?php
                        for($k=0;$k<count($newstr);$k++){
                                 $content= str_ireplace($newstr[$k],"<font color='#FF0000'>".$newstr[$k]."</font>",$content);
                        }
                        echo chinesesubstr($content,0,600);          
                          if(strlen($content)>600){echo "...";} ?>
          </td>
        </tr>
      </table>
      <p>
        <?php
                $key0.=$id.'@';
                }
                $key00=$key0;
                 if($row_count_sum>0){
                /* ???é???????ü×??????????±±í??*/
                $ins="update tb_temp set k_id='".$key00."'";
                $DB->query($ins);
                }
                /* *************************  */
          ?></p>
      <table width="100%" border="0">
        <tr>
          <td height="30">&nbsp;</td>
        </tr>
      </table>
          <?php
          if($row_count_sum>0){
          ?>
      <table width="850" border="0" cellpadding="2" cellspacing="1" bgcolor="#99CCCC" style="margin-left:15px; margin-right:15px">
        <tr height='26px' align="right">
          <th align="center" bgcolor="#E5ECF9">
            &nbsp;&nbsp; [·???????]</th>
        </tr>
        <tr height='26px'>
          <td align="center" bgcolor="#E5ECF9">
                  <?php
                        if(!$is_first){
                        ?>
            <a href="./search.php?page_num=1&keyword=<?php echo $keyword;?>">??????</a> <a href="./search.php?page_num=<?php echo ($page_num-1);?>&keyword=<?php echo $keyword;?>">??????</a>
            <?php
                        }
                        else{
                        ?>
            ??????&nbsp;&nbsp;??????
            <?php
                        }
                        if(!$is_last){
                        ?>
            <a href="./search.php?page_num=<?php echo ($page_num+1);?>&keyword=<?php echo $keyword;?>">??????</a> <a href="./search.php?page_num=<?php echo $page_count;?>&keyword=<?php echo $keyword;?>">×??ó????</a>
            <?php
                        }
                        else
                        {
                        ?>
            ??????&nbsp;&nbsp;×??ó????
            <?php
                        }
                        ?>
                  </td>
        </tr>
      </table>
                <?php
                }else{
                 $z_null="&nbsp;&nbsp;&nbsp;&nbsp;";
                 if($row_count_sum==0){echo  $z_null."±§?????????ì?÷????&nbsp;<font color='FF0000'>".$yuan."</font>&nbsp;?à????????????";
                 echo "<br><br><br>";
                 echo  $z_null."?ì?ì?? ?¨?é?ú??<br>";
                 echo  $z_null."?¤ ?é??????????×???·????ó<br>";
                 echo  $z_null."?¤ ??????????±?????×????????? '??'??'??'??'??' ??<br>";
                }
                }
                ?>
      </td>
  </tr>
</table>
<table width=100% border=0 cellspacing=0 cellpadding=0>
  <tr>
    <td height=30 align=center><font color="#7777CC">?ì?ì???÷</font> <a href=http://www.mrbccd.com><font color=#7777CC>&copy; 2008&nbsp;&nbsp;?????????ì?ì???ù???ú??????×??????÷???á???????ú±í?ì?ì??????±????÷???????????ò????</font></a>&nbsp;</td>
  </tr>
</table>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
main.php
<?php
$keyword =$_GET['keyword'];
$keyword2=urlEncode($keyword);
$xm=$_GET['xm'];
if($keyword==""){
        echo "对不起,您没有输入关键字!!<p><a href=\"javascript:history.back(1)\">点此返回</a></p>";
}
switch ($xm) {
   case  "baidu":
           $murl="http://www.baidu.com/s?wd=$keyword2";break;
   case "google":
                $murl="http://www.google.com/search?hl=zh-CN&q=$keyword2";break;
   case  "msn":
              $murl="http://cnweb.search.live.com/results.aspx?q=$keyword2&go=&form=QBRE";break;
   case  "zhongsou":
                 $murl="http://p.zhongsou.com/p?w=$keyword2";break;
   case  "sogou":
                 $murl="http://www.sogou.com/web?query=$keyword2";break;
   case  "tianw":
                 $murl="http://www.tianwang.com/cgi-bin/tw?cdtype=GB&word=$keyword2";break;
   case  "iask":
         $murl="http://www.iask.com/w?k=$keyword2&pid=33933&fromlianmeng=lianmeng";break;
   case  "yahoo":
                 $murl="http://search.cn.yahoo.com/search?ei=gbk&fr=fp-tab-web-ycn&meta=vl%3Dlang_zh-CN%26vl%3Dlang_zh-TW&pid=ysearch&source=ysearch_www_hp_button&p=$keyword2";  break;
   case  "17sou":
             $murl="http://www.17so.com/so?q=$keyword2";break;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>快快搜----<?php echo $keyword;?></title>
<style type="text/css">.navPoint {COLOR: white; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt}</style>
</head>
<body style="MARGIN: 0px" scroll=no><script>
function switchSysBar(){                //设置打开或关闭切换栏
if (switchPoint.innerText==3){
switchPoint.innerText=4
document.all("frmTitle").style.display="none"
}else{
switchPoint.innerText=3
document.all("frmTitle").style.display=""
}}
</script>
<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
  <tr>
    <td align="middle" noWrap vAlign="center" id="frmTitle"><iframe frameborder="0"  src="left.php?keyword=<?php echo $keyword;?>" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 150px; Z-INDEX: 2"> </iframe></td>
    <td style="WIDTH: 9pt" class=division>
    <table border="0" cellPadding="0" cellSpacing="0" height="100%" bgcolor="#47AFF">
      <tr>
        <td style="HEIGHT: 100%">
        <font style="FONT-SIZE: 9pt; CURSOR: default; COLOR: #ffffff">
        <br>
        <span class="navPoint" id="switchPoint" title="关闭/打开左栏">4</span><br>
        <br>
        屏幕切换 </font></td>
      </tr>
    </table>    </td>
    <td style="WIDTH: 100%"><iframe frameBorder="0" id="main" name="cjss" scrolling="yes" src=\'#\'"  echo $murl;?>" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1">
    </iframe></td>
  </tr>
</table>
<script>
if(window.screen.width<'1024'){                //如果屏蔽的宽度小于1024像素,那么调用自定义函数
        switchSysBar();
}
</script>
</body>
</html>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
<?php
function chinesesubstr($str,$start,$len) {         //$str??????,$start???????????λ???$len??????????
    $strlen=$start+$len;                                             //??$strlen?洢???????????????????????????λ???????????????
    for($i=0;$i<$strlen;$i++) {                                                                
        if(ord(substr($str,$i,1))>0xa0) {             //?????????????????ASCII?????????0xa0,????????,
                                                        //ord:ord() ??????????????????????? ASCII ?
            $tmpstr.=substr($str,$i,2);         //????????λ???????????$tmpstr???????????????
            $i++;                                                                  //???????1
        }
                else
            $tmpstr.=substr($str,$i,1);                  //????????????????????λ???????????$tmpstr
    }
    return $tmpstr;                                                            //?????????
}
/*function ExecTime(){                 //?????????亯??
                $time = explode(" ", microtime());
                $usec = (double)$time[0];
                $sec = (double)$time[1];
                return $sec + $usec;
}
*/
function getmicrotime(){
    list($usec, $sec) = explode(" ",microtime());
    return ((float)$usec + (float)$sec);
}
function gl($tt){                //?????????
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("!","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array(";","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array(":","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("*","");
        $tt=str_replace($str,'',$tt);
        $str=array(".","");
        $tt=str_replace($str,'',$tt);
        $str=array(",","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("?","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("'","");
        $tt=str_replace($str,'',$tt);
        $str=array('\\',"");
        $tt=str_replace($str,'',$tt);
        $str=array('/',"");
        $tt=str_replace($str,'',$tt);
        $str=array("(","");
        $tt=str_replace($str,'',$tt);
        $str=array(")","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("_","");
        $tt=str_replace($str,'',$tt);
        $str=array("-","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $str=str_replace($str,'',$tt);
        $str=array(" ","");
        $str=str_replace($str,'',$tt);
        return $str;
}
function dunhao($cc){
        if(substr($cc,0,2)=="??"){
                $cc= substr($cc,2);                        //????????????????
        }
        if(substr($cc,-3,2)=="??"){
                $cc= substr($cc,0,-3);                //????????????????
        }
       
        if(substr($cc,0,2)=="??" && substr($cc,-3,2)=="??"){
                $a= substr($cc,2);                        //????????????????
                $cc= substr($a,0,-3);                //????????????????
        }
        return $cc;
}
function gl1($tt){                //?????????
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("!","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array(";","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array(":","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("*","");
        $tt=str_replace($str,'',$tt);
        $str=array(".","");
        $tt=str_replace($str,'',$tt);
        $str=array(",","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("?","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("'","");
        $tt=str_replace($str,'',$tt);
        $str=array('\\',"");
        $tt=str_replace($str,'',$tt);
        $str=array('/',"");
        $tt=str_replace($str,'',$tt);
        $str=array("(","");
        $tt=str_replace($str,'',$tt);
        $str=array(")","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $tt=str_replace($str,'',$tt);
        $str=array("_","");
        $tt=str_replace($str,'',$tt);
        $str=array("-","");
        $tt=str_replace($str,'',$tt);
        $str=array("??","");
        $str=str_replace($str,'',$tt);
        return $str;
}
?>
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-27274-1-1.html 上篇帖子: 关于php配置参数 下篇帖子: php 生成sitemap xml文件(网站地图) 搜索结果 网站
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表