File manager - Edit - /home/webapp68.cm.in.th/u68319090006/Final/public/comments.php
Back
<?php include(__DIR__ . '/../config/db.php'); if ($_SERVER['REQUEST_METHOD'] == 'POST') { $article_id = intval($_POST['article_id']); $author_name = htmlspecialchars(trim($_POST['author_name'])); $comment = htmlspecialchars(trim($_POST['comment'])); if($article_id > 0 && !empty($author_name) && !empty($comment)){ $stmt = $conn->prepare("INSERT INTO comments (article_id, author_name, comment, is_approved) VALUES (?, ?, ?, 0)"); $stmt->bind_param("iss", $article_id, $author_name, $comment); $stmt->execute(); $stmt->close(); } header("Location: article.php?id=".$article_id); exit(); }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.4 |
proxy
|
phpinfo
|
Settings