-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdata.php
93 lines (81 loc) · 3 KB
/
data.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
$servername = "localhost";
$username = "root";
$password ="";
$dbname="Food";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error){
die("Connection failed: " . $conn->connect_error);
}
// $send=$_POST['send'];
if (isset($_POST["send"])) {
$fname=$_POST['firstname'];
$sname=$_POST['secondname'];
$email=$_POST['email'];
$phonenumber=$_POST['phonenumber'];
$addressp=$_POST['addressp'];
$age=$_POST['age'];
$numberofunc=$_POST['numberofunc'];
$dateofreserv=$_POST['dateofreserv'];
$sqlInsert = "INSERT INTO user(firstname , secondname , email , phonenumber,addressp,age,numberofunc,dateofreserv) VALUES (' $fname',' $sname',' $email', '$phonenumber', ' $addressp', ' $age', '$numberofunc', '$dateofreserv')";
if(mysqli_query($conn,$sqlInsert)){
session_start();
$_SESSION["send"] = "Passport booking has been successfully completed!";
header("Location:admin.php");
} else{
die("Something went wrong");
}
}
$conn->close();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Registration Form</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.2.2/dist/css/bootstrap.min.css" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
<link rel="stylesheet" href="style.css">
</head>
<body>
<div class="container">
<h2> <strong> online passport reservation </strong></h2>
<h6>Welcome to our online passport reservation website. Please fill out the form below</h6>
<form action="data.php" method="POST">
<div class="form-group">
First Name: <input type="text" class="form-control" name="firstname" placeholder="First name here..."/>
</div>
<div class="form-group">
Second Name: <input type="text" class="form-control" name="secondname" placeholder="Second name here..."/>
</div>
<div class="form-group">
Email : <input type="email" class="form-control" name="email" placeholder="Email here..."/>
</div>
<div class="form-group">
Phone number :<input type="text" class="form-control" name="phonenumber" placeholder="phone number here.."/>
</div>
<div class="form-group">
Address : <input type="text" class="form-control" name="addressp" placeholder="Address here..."/>
</div>
<div class="form-group">
Age :<input type="date" class="form-control" name="age" />
</div>
<div class="form-group">
Number of UNC:<input type="text" class="form-control" name="numberofunc" placeholder="Number Unified National Card here.."/>
</div>
<div class="form-group">
date of reservation :<input type="date" class="form-control" name="dateofreserv" />
</div>
<div class="form-btn">
<input type="submit" class="btn btn-primary" value="Register" name="send"/>
</div>
</form>
<div>
<div><p>Already Registered <a href="login.php">Login Here</a></p></div>
</div>
</div>
</body>
</html>