日期:2014-05-17 浏览次数:20440 次
<form name="form1" method="get" action="search.php"> <label for="title"></label> <div align="center"> 标题 <input type="text" name="title" id="title"> <input type="submit" name="submit" id="button" value="搜索"> </div> </form> <div align="center"> <?php header("Content-Type:text/html;charset=utf-8"); include("conn.php"); $biaoti=$_GET['title']; $biaoti2="%".$biaoti."%"; $sql="select * from news where title like '$biaoti2'"; $result=mysql_query($sql,$mylink); $result2=mysql_fetch_array($result); $i=0; echo "搜索内容:".$biaoti; echo "</br>"; echo "搜索结果总数:".$i; if($biaoti=="") { echo "模块初始化已完成"; } else { ?> <table width="1079" height="102" border="1"> <tr> <th width="81" height="45" bgcolor="#E2F4F6" scope="col">序号</th> <th width="122" bgcolor="#E2F4F6" scope="col">发布所用账号</th> <th width="346" bgcolor="#E2F4F6" scope="col">标题</th> <th width="192" bgcolor="#E2F4F6" scope="col">时间</th> <th width="144" bgcolor="#E2F4F6" scope="col">昵称</th> <th width="77" bgcolor="#E2F4F6" scope="col">评论数</th> <th width="71" bgcolor="#E2F4F6" scope="col">删除</th> </tr> <?php do { ?> <tr> <th height="49" scope="col"><?php echo $commentcount=$result2['id'];?></th> <th scope="col"><?php echo $result2['zhanghao'];?></th> <th scope="col"><a href="view.php?id=<?php echo $result2['id'];?>"> <?php echo $result2['title'];?> </a></th> <th scope="col"><?php echo date("Y-m-d H:i:s",strtotime($result2['time']));?></th> <th scope="col"><?php echo $result2['name'];?></th> <th scope="col"> <?php $sql2="select count(*) as abc from tbcomment where id='$commentcount'"; $sqlquery=mysql_query($sql2,$mylink); $result4=mysql_fetch_array($sqlquery); echo $result4['abc']; ?></th> <th scope="col"><a href="shanchu.php?id=<?php echo $result2['id'];?>"><?php echo "删除";?></a></th> </tr><?php } while($result2=mysql_fetch_array($result)) ?> </table> </div> <?php } ?>
<form name="form1" method="get" action="search.php"> <label for="title"></label> <div align="center"> 标题 <input type="text" name="title" id="title"> <input type="submit" name="submit" id="button" value="搜索"> </div> </form> <div align="center"> <?php header("Content-Type:text/html;charset=utf-8"); include("conn.php"); $