-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdate-book.php
44 lines (28 loc) · 1.14 KB
/
update-book.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
<?php
/// This must come first when we need access to the current session
session_start();
require("classes/components.php");
require("classes/utils.php");
Components::pageHeader("Update $title", ["style"], ["mobile-nav"]);
?>
<h2>Edit <?php echo $title; ?></h2>
<!--
When we submit the form, send the id back through as a URL parameter.
If this were not included and there was an error, the guard on line 16
would trigger the else block, sending us back to the product list page.
-->
<form method="POST" action="<?php echo $_SERVER["PHP_SELF"]; ?>?id=<?php echo $book["book_id"]; ?>" enctype="multipart/form-data" class="form">
<label>Title</label>
<input type="text" name="title" value="<?php echo $title; ?>">
<label>Author</label>
<input type="text" name="author" value="<?php echo $author; ?>">
<label>Price</label>
<input type="text" name="price" value="<?php echo $price; ?>">
<label>Cover image</label>
<input type="file" name="coverImage" value="">
<input class="button" type="submit" name="updateSubmit" value="Update Book Details">
<?php if ($output) { echo $output; } ?>
</form>
<?php
Components::pageFooter();
?>