The following files exists in this folder. Click to view.
commentUpload.php18 lines ASCII Unix (LF)
<?php
session_start();
require_once("databaseconnection.php");
$sql = "INSERT INTO comment (`userId`, `postId`, `date`, `commentorName`, `content`)
VALUES (:userId, :postId, :date, :commentorName, :content);";
$stm = $pdo->prepare($sql);
$stm->execute([
':userId' => $_SESSION["userId"],
':postId' => $_GET["mess"],
':date' => date("Y-m-d"),
':commentorName' => $_SESSION["name"],
':content' => $_POST["comment"]
]);
header("location:blogwatcher.php?mess={$_GET["mess"]}");
?>