-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmodifyTopic.php
More file actions
61 lines (45 loc) · 1.68 KB
/
modifyTopic.php
File metadata and controls
61 lines (45 loc) · 1.68 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
<?php $page_title = 'Modify Question'; ?>
<?php include('header.php'); ?>
<div class="container">
<?php
include_once 'db_configuration.php';
if (isset($_GET['topic'])){
$topic = $_GET['topic'];
$sql = "SELECT * FROM topics
WHERE topic = '$topic'";
if (!$result = $db->query($sql)) {
die ('There was an error running query[' . $connection->error . ']');
}//end if
}//end if
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
echo '<form action="modifyTheTopic.php" method="POST" enctype="multipart/form-data">
<br>
<h3>Modify Question: '.$row["topic"].' - '.$row["image_name"].'? </h3> <br>
<div>
<label for="id">Id</label>
<input type="text" class="form-control" name="id" value="'.$row["order"].'" maxlength="5" style=width:400px readonly><br>
</div>
<div>
<label for="name">Topic</label>
<input type="text" class="form-control" name="topic" value="'.$row["topic"].'" maxlength="255" style=width:400px required><br>
</div>
<div class="form-group col-md-4">
<label for="cadence">New Image Path (Not Required)</label>
<input type="file" name="fileToUpload" id="fileToUpload" maxlength="255">
</div>
<input type="hidden" class="form-control" name="image" value="'.$row["image_name"].'" maxlength="255" required>
<br>
<div class="text-left">
<button type="submit" name="submit" class="btn btn-primary btn-md align-items-center">Modify Topic</button>
</div>
<br> <br>
</form>';
}//end while
}//end if
else {
echo "0 results";
}//end else*/
?>
</div>