-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathadd-view.php
More file actions
57 lines (46 loc) · 1.37 KB
/
add-view.php
File metadata and controls
57 lines (46 loc) · 1.37 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
<?php
require_once 'include/common.php';
require_once 'include/protect.php';
$book = new Book();
if (isset($_POST['title'])) {
$book->title = $_POST['title'];
$book->isbn13 = $_POST['isbn13'];
$book->price = $_POST['price'];
}
?>
<html>
<body>
<?php include 'header.php' ?>
<h1>Add Book</h1>
<?php printErrors(); ?>
<form id='add-form' action='add.php' method='post'>
<table>
<tr>
<td>
Title
</td>
<td>
<input type='text' name='title' value='<?php echo $book->title; ?>' />
</td>
</tr>
<tr>
<td>
ISBN13
</td>
<td>
<input type='text' name='isbn13' value='<?php echo $book->isbn13; ?>' />
</td>
</tr>
<tr>
<td>
Price
</td>
<td>
<input type='text' name='price' value='<?php echo $book->price; ?>' />
</td>
</tr>
</table>
<input type='submit' />
</form>
</body>
</html>