-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcomment.php
37 lines (29 loc) · 1 KB
/
comment.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
require_once("./include/db_config.html");
require_once("./include/acm_membership_config.html");
if(isset($_POST['submit'])){
// Escape user inputs for security
$name = mysqli_real_escape_string($conn, $_POST['name']);
$email = mysqli_real_escape_string($conn, $_POST['email']);
$contact = mysqli_real_escape_string($conn, $_POST['contact']);
$comment = mysqli_real_escape_string($conn, $_POST['comment']);
$author = mysqli_real_escape_string($conn, $_POST['author']);
$postid = mysqli_real_escape_string($conn, $_POST['post_id']);
$profile_pic = mysqli_real_escape_string($conn, $_POST['profile_pic']);
/*
// attempt insert query execution
$sql = "INSERT INTO comment (comment_text,author_id,name,email,contact,post_id,profile_pic) VALUES ('$comment','$author','$name','$email','$contact','$postid','$profile_pic')";
if(mysqli_query($conn, $sql)){
header("Location : post.html?ref_id=$postid");
}
else
{
header("Location: error.html");
}*/
print_r($_POST);
}
else
{
header("Location: error.html");
}
?>