-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathreply.php
More file actions
88 lines (80 loc) · 2.46 KB
/
reply.php
File metadata and controls
88 lines (80 loc) · 2.46 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<html>
<head>
<title>Reply</title>
<style>
.formstyle h1{
background: #2A88AD;
padding: 20px 30px 15px 30px;
margin: -30px -30px 30px -30px;
border-radius: 10px 10px 0 0;
-webkit-border-radius: 10px 10px 0 0;
-moz-border-radius: 10px 10px 0 0;
color: #fff;
text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.12);
font: normal 30px 'Bitter', serif;
-moz-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
-webkit-box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
box-shadow: inset 0px 2px 2px 0px rgba(255, 255, 255, 0.17);
border: 1px solid #257C9E;
text-align: center;
}
.formstyle h1 > span{
display: block;
margin-top: 2px;
font: 13px Arial, Helvetica, sans-serif;
}
</style>
</head>
<body>
<?php
include 'nvgbar.php';
?>
<br><br>
<div class="formstyle">
<center>
<h1>Welcome to TechOn.com<span></span></h1>
</center>
</div>
<?php
//session_start();
//$reply=$_POST['reply'];
$topicid=$_GET['id1'];
include 'connect.php';
if(isset($_SESSION['signed_in']) == 1)
{
$content=$_POST['reply'];
$id=$_SESSION['id'];
$db=new PDO("mysql:host=localhost;dbname=techon","root","");
if($db)
{
$sql = "INSERT INTO
posts(posts_content,
posts_date,
posts_topic,
posts_by)
VALUES(?,?,?,?)";
$test=$db->prepare($sql);
$test->bindParam(1,$content);
$test->bindParam(2,date('y/m/d'));
$test->bindParam(3,$topicid);
$test->bindParam(4,$id);
if($test->execute())
redirect("location:topic.php?posts_topic=$topicid");
else
echo 'An error occured while inserting your reply. Please try again later.' . mysqli_error().' '.count_errors().;
}
else
{
echo 'An error occured while inserting your reply. Please try again later.' . mysql_error();
}
}
else
{
echo "<br><br><p style='font-size:34px; text-align:center; font-weight:bold;'>You need to sign in first</p>";
echo '<br><p style="text-align:center; font-size:19px; font-weight:bold; font-decoration:none;"><a href="signin.php">Sign In </a></p>';
}
echo "<br><br><br><br><br><br><br><br><br><br>";
include 'footer.php';
?>
</body>
</html>