⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 reply.php

📁 八星瓢虫留言本特点:采用PHP+Access数据库实现
💻 PHP
字号:
<?php
include_once("include/conn.php");
include_once("include/config.php");
include_once("include/function.php");
$action=$_GET["action"];
$id=chkint($_GET["id"]);
if ($action==""){alert("参数错误!",1);exit;}
switch ($action)
{
  case "reply":
    $rs=@new COM("ADODB.RecordSet") or die ("创建记录集失败!");
    $rs->open("select * from gb_main where id=".$id,$conn,1,1);
    if(!$rs->eof)
    {
      $gb_user=$rs->Fields["gb_user"]->Value;
      $gb_content=$rs->Fields["gb_content"]->Value;
      $gb_secret=$rs->Fields["gb_secret"]->Value;
      $gb_datetime=$rs->Fields["gb_datetime"]->Value;
      $gb_reply=htmlspecialchars($rs->Fields["gb_reply"]->Value);
    }
    else
    {
      alert("参数错误!",1);
      exit;
    }
    $rs->close;
    $rs=null;
  case "save":
    if (trim($reply_content)!="")
    {
      $rs=@new COM("ADODB.RecordSet") or die ("创建记录集失败!");
      $rs->open("select * from gb_main where id=".$id,$conn,1,3);
      if(!$rs->eof)
      {
        $rs->Fields["gb_reply"]->Value=stripslashes($_POST["reply_content"]);
        $rs->Fields["gb_replytime"]->Value=gettime();
        $rs->update;
      }
      else
      {
        alert("参数错误!",1);
        exit;
      }
      $rs->close;
      $rs=null;
      alert("回复成功!","index.php");
      exit;
    }
  default:
    break;
}
$conn->close();
$conn=null;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>回复留言--<?php echo $cfg_name; ?></title>
<link href="skin/<?php echo $cfg_skin; ?>.css" rel="stylesheet" type="text/css">
<meta name="keywords" content="<?php echo $cfg_keywords; ?>">
<meta name="description" content="<?php echo $cfg_description; ?>">
</head>

<body>
<!--回复开始-->
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30" height="20"><img src="skin/<?php echo $cfg_skin; ?>/top_left.gif" width="30" height="20"></td>
    <td background="skin/<?php echo $cfg_skin; ?>/top_mid.gif">&nbsp;</td>
    <td width="30"><img src="skin/<?php echo $cfg_skin; ?>/top_right.gif" width="30" height="20"></td>
  </tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0" class="td_border">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
      <form name="frm_reply" action="?id=<?php echo $id; ?>&action=save" method="post">
        <tr>
          <td align="center">
<?php
if ($cfg_editor==2){
?>
        <input type="hidden" name="reply_content" value="<?php echo $gb_reply; ?>">
        <IFRAME ID="eWebEditor1" src="editor/ewebeditor.htm?id=reply_content&style=coolblue" frameborder="0" scrolling="no" width="548" height="350"></IFRAME>
<?php
}
else
{
?>
        <textarea name="reply_content" rows="10" class="frm_textarea"><?php echo $gb_reply; ?></textarea>
<?php
}
?>
          </td>
        </tr>
        <tr>
          <td height="40" align="center">
          <input name="btnSubmit" type="submit" class="frm_button" id="btnSubmit" value="回复留言">
          &nbsp;&nbsp;
          <input name="btnBack" type="reset" class="frm_button" id="btnBack" value="取消返回" onClick="javascript:history.back();">          
          </td>
        </tr>
        <tr>
          <td align="center"><?php if($gb_secret==1){echo "<font color=\"#FF0000\">[保密]</font>";} ?><?php echo $gb_user; ?> 于 <?php echo $gb_datetime; ?> 的留言</td>
        </tr>
        <tr>
          <td><hr></td>
        </tr>
        <tr>
          <td>
          <span style="line-height:150%; width:100%; word-wrap: break-word; padding-left:10px; padding-right:10px;">
          <?php echo $gb_content; ?>
          </span>
          </td>
        </tr>
      </form>    
      </table>
    </td>
  </tr>
</table>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="30" height="15"><img src="skin/<?php echo $cfg_skin; ?>/bom_left.gif" width="30" height="15"></td>
    <td background="skin/<?php echo $cfg_skin; ?>/bom_mid.gif">&nbsp;</td>
    <td width="30"><img src="skin/<?php echo $cfg_skin; ?>/bom_right.gif" width="30" height="15"></td>
  </tr>
</table>
<!--回复结束-->
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -