This repository has been archived on 2025-12-28. You can view files and clone it, but cannot push or open issues or pull requests.
inkletblot-com-v1/php gallery/comment_send.php
2019-12-02 12:10:45 +10:30

28 lines
671 B
PHP

<?php
include 'connect.php';
$id=intval($_POST['id']);
$name=$_POST['name'];
$comment=$_POST['comment'];
$sql="INSERT INTO comments (commentName, commentText, uploadNo) VALUES (?, ?, ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param('ssi', $name, $comment, $id);
if ($result = $stmt->execute())
{
echo '1 record added.' . '</br>';
echo 'id: ' . htmlentities($id, ENT_QUOTES | ENT_HTML5, 'UTF-8') . ' comment: ' . htmlentities($comment, ENT_QUOTES | ENT_HTML5, 'UTF-8') . ' name: ' . htmlentities($name, ENT_QUOTES | ENT_HTML5, 'UTF-8');
}
else{
echo 'update failed.' . $conn->error . '</br>';
}
echo "<script>window.history.back();</script>";
?>