forked from Karteek-Gurugubelli/Carparking_management_System
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conns2.php
38 lines (34 loc) · 1 KB
/
conns2.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
<?php
$fname = filter_input(INPUT_POST,'fname');
$lname = filter_input(INPUT_POST,'lname');
$birthday = filter_input(INPUT_POST,'birthday');
$gender = filter_input(INPUT_POST,'gender');
$email = filter_input(INPUT_POST,'email');
$phone = filter_input(INPUT_POST,'phone');
$date = filter_input(INPUT_POST,'date');
$time = filter_input(INPUT_POST,'time');
if(!empty($fname)){
if (!empty($lname)){
$host = "localhost";
$dbusername = "root";
$dbpassword = "";
$dbname = "cars";
$conn = new mysqli($host, $dbusername, $dbpassword, $dbname);
if (mysqli_connect_error()){
die('Connect Error('. mysqli_connect_error() .') '
. mysqli_connect_error());
}
else{
$sql = "INSERT INTO s2(fname,lname,birthday,gender,email,phone,date,time)
value ('$fname','$lname','$birthday','$gender','$email','$phone','date','time')";
if ($conn->query($sql)){
echo"Your slot has been Booked Successfully";
}
else{
echo"Error: " . sql ."<br>". $conn->error;
}
$conn->close();
}
}
}
?>