-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathquestions.php
More file actions
29 lines (29 loc) · 1.14 KB
/
questions.php
File metadata and controls
29 lines (29 loc) · 1.14 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
<?php include 'includes/header.php'; ?>
<?php include 'config/config.php';?>
<?php include 'lib/Database.php';?>
<?php
$number = (int) $_GET['n'];
$db = new Database();
$query = "SELECT * FROM `questions` WHERE question_number = $number";
$result = $db->select($query);
$query = "SELECT * FROM `choices` WHERE question_number = $number";
$choices = $db->select($query);
$query1 = "SELECT * FROM `questions`";
$results = $db->select($query1);
$count = $results->num_rows;
?>
<div class="jumbotron">
<h3 class="text-center"><?php echo "Question ".$number." of ".$count; ?></h3>
<h4 class="text-center">What Does PHP Stands for ?</h4>
</div>
<form class="form-horizontal" action="process.php" method="post">
<ul class="question">
<?php while($row = $choices->fetch_assoc()) : ?>
<li><input type='radio' name='choice' value='<?php echo $row['id']; ?>'/>
<?php echo $row['text']; ?></li>
<?php endwhile; ?>
</ul>
<input type="submit" value="Next" class="btn btn-success center-block btn-block" name="submit"/>
<input type="hidden" name="number" value ="<?php echo $number; ?>"/>
</form>
<?php include 'includes/footer.php'; ?>