View sourcecode

The following files exists in this folder. Click to view.

commentUpload.php

18 lines ASCII Unix (LF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?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"]}");
?>