forked from jindaladiti1806/Krishidarpan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
practise.php
80 lines (65 loc) · 1.81 KB
/
practise.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
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
<!DOCTYPE html>
<html>
<head>
<title>FAQs</title>
</head>
<style>
body{
background-image:linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.5)),url(pictures/question2.jpg);
background-size: 1600px 1850px;
}
</style>
<body>
<?php
include("header.php");
?>
<div col-lg-12 style="text-align: center;color: pink;text-decoration: underline;font-family: Comic Sans MS;">
<h1>FAQs</h1>
<?php
include("root/db_connection.php");
$ab=$db->query("select * from question_master");
while($cd=$ab->fetch(PDO::FETCH_ASSOC))
{
$id = $cd['id'];
echo " QUESTION :- ";
echo $cd['question'];
?>
<br>
<br>
<?php
$ef=$db->query("select * from answer_master where question_id=$id order by id desc limit 1");
while($gh=$ef->fetch(PDO::FETCH_ASSOC))
{
echo " ANSWER :- ";
echo $gh['answer'];
}
?>
<br>
<form action="addans.php" method="POST">
<div id="ans">
<textarea rows="4" cols="50" name="answer" style="color:black">Write Your Answer Here ......</textarea>
</div>
<input type="hidden" value="<?php echo $id; ?>" name="questionid">
<button class="btn btn-md btn-info" type="submit" style="color: #fff">Add answer</button>
<button class="btn btn-md btn-success" type="button"><a href="see_answer.php?ques_id=<?php echo $cd['id']; ?>">see more</a></button>
</form>
<br>
<br>
<?php
}
?>
<form action="addquestion.php" method="POST">
<div id="ans">
<textarea rows="4" cols="50" name="question" style="color: black">Write Your Answer Here ......</textarea>
</div>
<input type="hidden" value="<?php echo $id; ?>" name="questionid">
<button class="btn btn-md btn-info" type="submit" >Add question</button>
</form>
<script src="js/jquery.js"></script>
<script src="js/jquery.min.js"></script>
<?php
include("footer.php");
?>
</div>
</body>
</html>