public function replay() { $name = isset($_POST['name']) ? trim($_POST['name']) : ''; $email = isset($_POST['email']) ? trim($_POST['email']) : ''; $content = isset($_POST['content']) ? trim($_POST['content']) : ''; $aid = isset($_POST['aid']) ? intval($_POST['aid']) : ''; // 过滤 $name = htmlspecialchars($name, ENT_QUOTES); $email = htmlspecialchars($email, ENT_QUOTES); $content = htmlspecialchars($content, ENT_QUOTES); if (empty($name) || empty($email) || empty($content) || empty($aid)) { header("refresh:1;url=index.php"); exit; } $talk = new ReplayModel(); $talks = $talk->insertArticleReplay($name, $email, $content, $aid); header("refresh:1;url=index.php"); }