代码拉取完成,页面将自动刷新
<?php
if (!empty($_SESSION['fileid']) ) {
header("Location:./index.php");
exit();
}
else{
include("./sql_conn/conn.php");
include("./login_session_check.php");
$content = $_POST['message'];
$username = $_SESSION['uid'];
if (empty($_SESSION['fileid'])) {
header("Location:./index.php");
exit();
}
$fileid = intval($_SESSION['fileid']);
$comtime = date('Y-m-d h:i:s', time());
// echo $fileid;
$comment_sql = "INSERT INTO comment (id, fileid, username, content, comtime)
VALUES (NULL, '".$fileid."', '".$username."', '".$content."', '".$comtime."')";
// echo $comment_sql;
$res = mysqli_query($conn,$comment_sql);
if ($res>0) {
echo "<script language='javascript' type='text/javascript'>";
echo "alert('留言成功');";
echo "location.href='./blog_article.php?list=".$fileid."#comments';";
echo "</script>";
exit();
}
}
@session_start();
unset($_SESSION["fileid"]);
?>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。