-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestion.php
More file actions
105 lines (80 loc) · 4.73 KB
/
question.php
File metadata and controls
105 lines (80 loc) · 4.73 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
require_once('include/header.php');
require_once('include/sidebar.php');
// error_reporting(0);
$s = $conn->real_escape_string(strip_tags($_GET['s']));
$result = $conn->query("SELECT * FROM questions WHERE qid LIKE '$s'");
$row_single = $result->fetch_assoc();
?>
<!-- Main Content -->
<div class="main-content">
<section class="section">
<div class="card col-12 col-md-8 col-lg-12">
<div class="card-header">
<h4>Question </h4>
</div>
<form method="post" action="scripts.php" autocomplete="off" enctype="multipart/form-data">
<div class="card-body" >
<div class="form-row">
<div class="form-group col-md-5">
<label>Category</label>
<select class="form-control" name="category">
<?php
$result = $conn->query("SELECT * FROM category WHERE status = 1");
while($row = $result -> fetch_assoc()) {
echo '<option value="'.$row['category'].'">'.$row['category'].'</option>';
}
?>
</select>
</div>
<div class="col-md-1"></div>
<div class="form-group col-md-5">
<label>Mode</label>
<select class="form-control" name="mode">
<option value="easy">Easy</option>
<option value="medium">Medium</option>
<option value="hard">Hard</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4"> Question <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="ques" placeholder=" Question" value="<?php echo $row_single['ques']; ?>" required maxlength="150">
</div>
<div class="form-group col-md-6">
<label for="inputEmail4"> Answer <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="answ" placeholder=" Answer" value="<?php echo $row_single['ans']; ?>" required maxlength="150">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4"> Option 1 <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="optn1" placeholder="Option 1" value="<?php echo $row_single['optn1']; ?>" required maxlength="150">
</div>
<div class="form-group col-md-6">
<label for="inputEmail4"> Option 2 <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="optn2" placeholder=" Option 2" value="<?php echo $row_single['optn2']; ?>" required maxlength="150">
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<label for="inputEmail4"> Option 3 <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="optn3" placeholder=" Option 3" value="<?php echo $row_single['optn3']; ?>" required maxlength="150">
</div>
<div class="form-group col-md-6">
<label for="inputEmail4"> Option 4 <spam style="color:red;">*</spam></label>
<input type="text" class="form-control" id="inputText" name="optn4" placeholder=" Option 4" value="<?php echo $row_single['optn4']; ?>" required maxlength="150">
</div>
</div>
</div>
<div class="card-footer text-center">
<input type="hidden" name="q" value="<?php echo $s; ?>" />
<button type="submit" name="UpdQuesiton" value="" class="btn btn-primary">Update</button>
</div>
</div>
</form>
</section>
<?php
require_once('include/footer.php');
?>