博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
留言版
阅读量:6853 次
发布时间:2019-06-26

本文共 4740 字,大约阅读时间需要 15 分钟。

<?php ini_set("error_reporting","E_ALL & ~E_NOTICE"); ?><?php

include_once("top.php");
?>
<table width="779" height="23" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="292" background="images/dh_back.gif"><div align="right">今天是:&nbsp;<script language=JavaScript>
   today=new Date();
   function initArray(){
   this.length=initArray.arguments.length
   for(var i=0;i<this.length;i++)
   this[i+1]=initArray.arguments[i]  }
   var d=new initArray(
     "星期日",
     "星期一",
     "星期二",
     "星期三",
     "星期四",
     "星期五",
     "星期六");
document.write(
     "<font color=#000000 style='font-size:9pt;font-family: 宋体'> ",
     today.getYear(),"年",
     today.getMonth()+1,"月",
     today.getDate(),"日",
   "&nbsp;&nbsp;",
     d[today.getDay()+1],
 "</font>" );
</script></div></td>
    <td width="487" background="images/dh_back.gif"><div align="center">您当前的位置:明日留言本&nbsp;>>&nbsp;<a href="searchword.php" class="a1">查询留言</a></div></td>
  </tr>
</table>
<table width="779" height="500" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
  <tr>
    <td width="5" height="315" bgcolor="#F4ECEC"></td>
    <td width="200" valign="top"><?php include_once("left.php");?></td>
    <td width="6" bgcolor="#F4ECEC"></td>
    <td  valign="top"><table width="520" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td></td>
      </tr>
    </table>
      <table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#941F53">
 
  <script language="javascript">
    function chkinput_search(form){
      if(form.type.value==""){
     alert('请选择查询条件!');
     form.type.focus();
     return(false);
   }
    if(form.keyword.value==""){
     alert('请输入查询关键字!');
     form.keyword.focus();
     return(false);
   }
   return(true);
   
    }
  </script>
       <form name="form1" method="post" action="<?php echo $_SERVER["PHP_SELF"];?> " οnsubmit="return chkinput_search(this)">
     <tr>
          <td bgcolor="#FFFFFF" valign="top"><table width="550" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td bgcolor="#941F53">&nbsp;&nbsp;查找留言</td>
            </tr>
          </table>
            <table width="550" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td><div align="center">请选择查找方式:
                  <select name="type">
        <option value="">请选择</option>
                    <option value="1">主题</option>
                    <option value="2">内容</option>
                    <option value="3">留言者</option>
                  </select>&nbsp;<input type="text" name="keyword" size="25" class="inputcss">&nbsp;<input type="submit" value="查询" class="buttoncss" name="submit">
                </div></td>
              </tr>
            </table>
  
    </td>
        </tr>
  </form>
      </table>
  
  
   <?php
    
    if($_POST["submit"]!=""){
      $type=$_POST["type"];
      $keyword=$_POST["keyword"];
   if($type==1){
    $sql=mysql_query("select * from tb_leaveword where title like '%".$keyword."%'",$conn);
   }elseif($type==2){
    $sql=mysql_query("select * from tb_leaveword where content like '%".$keyword."%'",$conn);
   }elseif($type==3){
    $sql0=mysql_query("select id from tb_user where usernc='".$keyword."'",$conn);
    $info0=mysql_fetch_array($sql0);
    $sql=mysql_query("select * from tb_leaveword where userid='".$info0["id"]."'",$conn);
   }
  
   $info=mysql_fetch_array($sql);
   if($info==false){
    echo "<br><br><div align=center>对不起,没有查找到您要查找的内容!</div>";
   }else{
     do{
   ?>
  
  
   <table width="520" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td></td>
      </tr>
    </table>
      <table width="550" height="155" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FCD424">
        <tr>
          <td bgcolor="#FFFFFF" valign="top"><table width="550" height="24" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td bgcolor="#941F53">&nbsp;主&nbsp;&nbsp;题:<?php echo unhtml($info["title"]);?></td>
            </tr>
          </table>
            <table width="550" height="5" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td></td>
              </tr>
            </table>
   
   <table width="550" height="120" border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <td width="150" height="90"><div align="center"><img src="<?php
     $sql1=mysql_query("select usernc,face,ip,email,qq from tb_user where id='".$info["userid"]."'",$conn);
     $info1=mysql_fetch_array($sql1);
     echo $info1["face"];
    
     ?>" /><br><?php echo $info1["usernc"]; ?></div></td>
                <td width="10" background="images/line_down.gif"></td>
                <td width="390" rowspan="2"><?php echo unhtml($info["content"]);?></td>
              </tr>
              <tr>
                <td height="30"><div align="center"><img src="images/email.gif" width="45" height="16" alt="<?php echo $info1[email];?>"/><img src="images/ip.gif" width="55" height="16"  alt="<?php echo $info1[ip];?>"/><img src="images/qq.gif" width="45" height="16"  alt="<?php echo $info1[qq];?>"/></div></td>
                <td width="10" background="images/line_down.gif"></td>
              </tr>
            </table>
   
    </td>
        </tr>
      </table>
  
   <?php
      }while($info=mysql_fetch_array($sql));
   }
    }
  
   ?>
  
  
    </td>
    <td width="5" bgcolor="#F4ECEC"></td>
  </tr>
</table>
<?php
include_once("bottom.php");
?>

转载于:https://www.cnblogs.com/qiuyang1/p/3755613.html

你可能感兴趣的文章
微信授权莫名创建用户数据失败的原因
查看>>
网络高手修身
查看>>
JavaWeb综合案例-键盘模拟
查看>>
Android Day03-SQLite数据库操作及ListView详解
查看>>
Looking for APAC Operations IT XML Database Developer in Shenzhen and Hongkong
查看>>
Myeclipse常用快捷键
查看>>
我的友情链接
查看>>
Unity3d多线程
查看>>
炉石传说 C# 开发笔记 (源代码整理公开)
查看>>
前端文摘:Web 开发模式演变历史和趋势
查看>>
最大子数组和问题的解
查看>>
cout设置输出数据不显示科学计数法
查看>>
zoj 1659 Mobile Phone Coverage(矩形面积并)
查看>>
python学习 day3
查看>>
Centos 6.4下用Squid配置反向代理多个内网WEB服务器
查看>>
王者荣耀之父姚晓光“奇葩”的工作理念
查看>>
Flask 信号
查看>>
Extjs checkbox数值回显
查看>>
SpringBatch配置数据库
查看>>
SVN使用svn+ssh协议连接服务器时重复提示输入密码 解决办法
查看>>