-
Notifications
You must be signed in to change notification settings - Fork 0
/
reply.php
45 lines (33 loc) · 1 KB
/
reply.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
38
39
40
41
42
43
44
45
<?php
session_start();
include 'connect.php';
include 'header.php';
$id=$_GET['id'];
if(!isset($_SESSION['login_user']))
{
echo 'You must be signed in to post a reply.';
}
else
{
$reply=$_POST['reply-content'];
$userid=$_SESSION['user_id'] ;
$sql = "INSERT INTO
posts(post_content,
post_time,
post_topic,
post_by)
VALUES ('$reply',
NOW(),
$id,
" . $_SESSION['userid'] . ") ";
$result=mysql_query($sql);
if(!$result)
{
echo 'Your reply has not been saved, please try again later'.mysql_error();
}
else
{
echo 'Your reply has been saved, check out the topic';
}
}
?>