为什么不搜一下呢,这里已经有很多了。

解决方案 »

  1.   

    这个要根据你网站自身的数据库结构来做一个吧
      

  2.   

    <tr>
                    <td valign="top">
    <?
    if($key=="")
    {   echo "<center><font color=red>你没有输入任何名称,让我怎么搜索呢?</font></center>";
       exit;
    }$bdb=mysql_query("select * from $news where title like '%$key%' order by time desc");
    while($adb=mysql_fetch_array($bdb)){
    $date1=date("Y年/m月/d日",$adb["time"]);$title=str_replace($key,"<font color=red>$key</font>",$adb["title"]);
    $len=strlen($adb["neirong"]);
    if($len<="200")
     $content=$adb["neirong"];
    else
     $content=substr($adb["neirong"],"0","200")."...";echo "□&nbsp;<a href=show.php?id=$adb[id]><span class='unnamed1'>$title</span></a>&nbsp;<font color=#999999>($date1)</font><br>";
    echo "<font color=#999999 size=2>&nbsp;&nbsp;&nbsp;&nbsp;$content</font><br><br>";
    }
    ?></td>
                  </tr>
                  <tr>
                    <td>
                      <div align="right">
    <?
    $page="10";
    $nums=mysql_query("select count(id) from $news where title like '%$key%'");
    $nums=mysql_fetch_array($nums);
    echo "[共搜索到<b>$nums[0]</b>条新闻]";?>我自己用的,共享了。
      

  3.   

    把你数据库结构列出来,这样才好写的.