200分求站内搜索的代码。 为什么不搜一下呢,这里已经有很多了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这个要根据你网站自身的数据库结构来做一个吧 <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 "□ <a href=show.php?id=$adb[id]><span class='unnamed1'>$title</span></a> <font color=#999999>($date1)</font><br>";echo "<font color=#999999 size=2> $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>条新闻]";?>我自己用的,共享了。 把你数据库结构列出来,这样才好写的. 请教:关于分页的问题! php时间 为什么下拉框的第一个是已经selected的 大白菜问个PHP数组的问题 急!100分求``Zend_File_Transfer_Adapter_Http()上传图片问题 创建mysql表的语句是否要加引号 请问用静态页怎样完成动态页的功能,例如:http://www.cnpre.com/这个网站,速度很 在函数中改变变量的值,怎么带回来? 是权限问题?程序问题?配置问题? 帮帮菜鸟vtelsai 验证问题 连接SQL2000??
<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 "□ <a href=show.php?id=$adb[id]><span class='unnamed1'>$title</span></a> <font color=#999999>($date1)</font><br>";
echo "<font color=#999999 size=2> $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>条新闻]";?>我自己用的,共享了。