-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbook.php
More file actions
36 lines (27 loc) · 902 Bytes
/
book.php
File metadata and controls
36 lines (27 loc) · 902 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
33
34
35
36
<?php
$host="localhost";
$user="root";
$pwd="rec";
$db="appointment";
$conn=mysqli_connect($host,$user,$pwd,$db);
if (mysqli_connect_errno())
{
die("Failed to connect to MySQL: " . mysqli_connect_error());
}
$fname=$_POST['fname'];
$lname=$_POST['lname'];
$mail=$_POST['mail'];
$phone=$_POST['phone'];
$appointmentdate=$_POST['date'];
$appointmenttime=$_POST['time'];
$sql="insert into appointment.details (fname,lname,mail,phone,appointmentdate,appointmenttime) values('".$fname."','".$lname."','".$mail."','".$phone."','".$appointmentdate."','".$appointmenttime."');";
if (mysqli_query($conn, $sql)) {
echo "<html><body>appointment succcessfull</body></html>";
header("Location: index.php?status=success");
}
else {
echo "appointment could not be made..";
header("Location: index.php?status=failed");
}
mysqli_close($conn);
?>