-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinsert.php
34 lines (24 loc) · 856 Bytes
/
insert.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
<?php
include "class-database.php";
//include "koneksi.php";
//instansiasi setting propertis database
//$db = new database($host, $user, $pass, $mydb);
//koneksi mysql via method
//$db->koneksi();
if(isset($_POST['SAVE']))
{
$judul = $_POST['JUDUL'];
$pengarang = $_POST['PENGARANG'];
$penerbit = $_POST['PENERBIT'];
$thn = $_POST['TAHUN_TERBIT'];
//insert data buku via method
$db->addBuku($judul,$pengarang,$penerbit,$thn);
}
?>
<form method="post" action="insert.php">
<input type="text" name="JUDUL" placeholder="Judul"><br>
<input type="text" name="PENGARANG" placeholder="Pengarang"><br>
<input type="text" name="PENERBIT" placeholder="Penerbit"><br>
<input type="text" name="TAHUN_TERBIT" placeholder="Tahun Terbit"><br>
<input type="submit" name="SAVE" Value="SAVE"><br>
</form>