-
Notifications
You must be signed in to change notification settings - Fork 0
/
insert.php
70 lines (58 loc) · 1.35 KB
/
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
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
60
61
62
63
64
65
66
67
68
69
70
<?php
require('database.php');
if(isset($_POST['send']))
{
$nama = $_POST['nama'];
$des = $_POST['des'];
$dateCreated = date("Y-m-d H:i:s");
$insert = "INSERT into `user` (nama, des, date1) values ('$nama','$des','$dateCreated')";
$test = mysqli_query($connect,$insert);
if($test){
?>
<script>
alert('success');
window.location.href="show.php";
</script>
<?php
} else {
?>
<script>
alert('error');
</script>
<?php }
}
?>
<html>
<head>
</head>
<body>
<style>
.box {border: black solid;
height:500px;
width:600px;}
</style>
<table>
<tr>
<td width="50%"></td>
<td class="box" align="center">
<table>
<tr>
<th><h1>Insert Detail</h1></th>
</tr>
<tr>
<td>
<form action="" method="post" enctype="multipart/form-data">
Name: <input name="nama" type="text" placeholder="Insert Name" /><br/><br/>
Description: <input name="des" type="text" placeholder="Insert Description" /><br/><br/>
<a href="show.php"><input name="view" type="button" value="View List" /></a>
<input name="send" type="submit" value="Send" /><br/><br/>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>