-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsaving.php
More file actions
32 lines (24 loc) · 841 Bytes
/
Copy pathsaving.php
File metadata and controls
32 lines (24 loc) · 841 Bytes
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
<?php
$conn = new mysqli("localhost","root","","guestbook");
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$d=date('md');
$name=$_POST['nama'];
$Activity=$_POST['kegiatan'];
$Tel=$_POST['tel'];
$Email=$_POST['email'];
$Occupy=$_POST['jab'];
$SatKer=$_POST['satker'];
$JK=$_POST['jk'];
$KB=$Activity.$d.$Tel;
$sql="INSERT INTO booking (nama,k,tel,email,jab,satker,jk,booking) values ('$name','$Activity','$Tel','$Email','$Occupy','$SatKer','$JK','$KB')";
if ($conn->query($sql) === TRUE) {
echo "<script>alert('Booking sukses, $Name ')</script>";
header('location: approved.php?kb='.$KB);
} else {
echo "<script>alert('Error: " . $sql . "<br>" . $conn->error . "')</script>";
echo "alert('MOHON LAKUKAN REGISTRASI ULANG')";
}
$conn->close();
?>