1 Star 0 Fork 0

ica / lyb_0

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
reply.php 851 Bytes
一键复制 编辑 原始数据 按行查看 历史
Moe-boshi 提交于 2018-06-18 22:44 . 第一次提交
<?php
session_start();
if(!isset($_SESSION['username'])){
if ($_SESSION['admin']!="1"){
header("Location:login.php");
exit;
}
}
require ("./core/conn.php");
if ($_POST) {
if (get_magic_quotes_gpc()) {
$reply = htmlspecialchars(trim($_POST['reply']));
} else {
$reply = addslashes(htmlspecialchars(trim($_POST['reply'])));
}
// 修改为空时,将修改时间置为空
$replytime = $reply ? time() : 'NULL';
$update_sql = "UPDATE msg SET reply = '$reply', replytime = $replytime WHERE id = $_POST[id]";
if (mysqli_query($conn, $update_sql)) {
exit('<script language="javascript">alert("回复成功!");self.location = "index.php";</script>');
} else {
exit('回复失败:' . mysqli_error() . '[ <a href="javascript:history.back()">返 回</a> ]');
}
}
?>
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
PHP
1
https://gitee.com/ica520/lyb_0.git
git@gitee.com:ica520/lyb_0.git
ica520
lyb_0
lyb_0
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891