项目结构:
498)this.width=498; onmousewheel=javascript:return big(this) style=max-width:90% alt=\ width=274 src=http://www.bkjia.com/uploadfile/2013/0904/20130904095406958.png>
开始搜索: 这里搜索关键字(大这)
498)this.width=498; onmousewheel=javascript:return big(this) style=max-width:90% alt=\ width=640 src=http://www.bkjia.com/uploadfile/2013/0904/20130904095406563.png>
搜索结果: 高亮显示
498)this.width=498; onmousewheel=javascript:return big(this) style=max-width:90% alt=\ width=565 src=http://www.bkjia.com/uploadfile/2013/0904/20130904095406399.png>
项目所需数据库结构:
498)this.width=498; onmousewheel=javascript:return big(this) style=max-width:90% alt=\ width=640 src=http://www.bkjia.com/uploadfile/2013/0904/20130904095406831.png>
实现代码:
conn.php
searchanddisplaywithcolor.php
center> method=get> 关键字:text name=keyword /> submit value=搜索 />
0 align=center cellpadding=5 cellspacing=1 bgcolor=#add3ef> #eff3ff> 标题:black>=$row[title]?> 用户:black>=$row[user] ?> right>preedit.php?id==$row[id]?>>编辑 | href=delete.php?id==$row[id]?>>删除
#ffffff> 内容:=$row[content]?>
#ffffff> right>发表日期:=$row[lastdate]?>
说明:在这个小程序中,有一点不足之处在于,只能同时搜索两个关键字,并且中间用空格 隔开,如果只是搜索一个关键字,如:大
显示的时候会出现乱码 ……^|_|^,这是由于下面代码的结果:
//用空格符把关键字分割开 $key=explode(' ', $_get[keyword]);
如果要改进的话,在这里的后面就要做一下判断了。
http://www.bkjia.com/phpjc/445701.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/445701.htmltecharticle项目结构: 498)this.width=498;' onmousewheel = 'javascript:return big(this)' height=183 alt=\ width=274 src=http://www.bkjia.com/uploadfile/2013/0904/2013090409540695...