-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforumAnswer.php
More file actions
68 lines (45 loc) · 1.25 KB
/
forumAnswer.php
File metadata and controls
68 lines (45 loc) · 1.25 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
<?php
require "connection.php";
if($_GET) {
$var=$_GET["ID"];
//$con = new mysqli('localhost','root','','h');
$query1="select * from tab1 where id = '".$var."'";
$result=$con->query($query1);
$row=$result->fetch_assoc();
echo '<div id="que">';
//echo "<div style='color:green;''>"
//$id = $row["id"];
echo "<a href = 'forumAnswer.php?ID= ".$var." '> ".$row["que"]." </a>" ;
echo "<ul>";
echo "<li>".$row['user']."</li>";
echo "<li>";
$time = time();
echo date('d - m - y',$time);
echo "</li>";
echo "</ul></div>";
echo '<div id="que">';
echo $row['que_desc']."<br><br> </div>" ;
$query="select * from uttar where que_id = '".$var."'";
echo "<h3>Top Answers</h3>";
$result=$con->query($query);
while($row=$result->fetch_assoc())
{
echo "<div>";
echo ($row["answer"]);
echo "<ul>";
echo "<li>".$row['user']."</li>";
echo "<li>";
$time = time();
echo date('d - m - y',$time);
echo "</li>";
echo "</ul>";
echo "</div>";
}
}
?>
<h2>Reply..</h2>
<form method="POST" action="forumReply.php">
<input type="textarea" name="answer"><br>
<input type="hidden" name="qId" value="<?php print $var ; ?>"><br>
<input type="submit" name="submit"><br>
</form>