-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaddKey.php
More file actions
53 lines (41 loc) · 1.1 KB
/
addKey.php
File metadata and controls
53 lines (41 loc) · 1.1 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
<!DOCTYPE>
<?php
include_once 'header.php';
include("includes/dbh-inc.php");
?>
<html>
<head>
<title>Add Keyword</title>
</head>
<body bgcolor="blue">
<form action="addKey.php" method="post" enctype="multipart/form-data">
<table align="center" width="600" border="2" bgcolor = "white">
<tr align = "center">
<td colspan="8"><h2>Insert New Keyword </h2></td>
</tr>
<tr>
<td align ="center">Book Keyword:</td>
<td><input type="text" name="keyword" size ="60" /></td>
</tr>
<tr>
<td align ="center">Book ID:</td>
<td><input type="text" name="bookid" /></td>
</tr>
<tr align="center">
<td colspan="8"><input type="submit" name="insert_key" value="Add Now" /></td>
</tr>
</table>
</form>
</body>
</html>
<?php
if(isset($_POST['insert_key'])){
$book_key = $_POST['keyword'];
$book_id = $_POST['bookid'];
$insert_keys = "insert into keywords(keyword,bookid) values ('$book_key','$book_id')";
$insert_keyss = mysqli_query($connection, $insert_keys);
}
?>
<?php
include_once 'footer.php';
?>