-
Notifications
You must be signed in to change notification settings - Fork 0
/
bookform.php
50 lines (35 loc) · 1.12 KB
/
bookform.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
<?php
session_start();
$hostname = "localhost";
$mysql_user = "root";
$password = "";
$database = "Flight";
$bd = mysql_connect($hostname, $mysql_user, $password) or die("Oops some thing went wrong");
mysql_select_db($database, $bd) or die("Oops some thing went wrong");
foreach($_POST as $name => $content)
{ // Most people refer to $key => $value
$Flight_id = $name;
}
//echo $Flight_id;
$seats= $_SESSION['seats'];
$_SESSION['seats'] = $seats;
$_SESSION['flight_id'] = $Flight_id;
echo $seats;
?>
<html>
<head>
<title>Book Seats</title>
</head>
<body>
<center><div id = "book">
<form method = "POST" action = "action.php">
<input type = "text" placeholder = "Enter name" name = "f_name"><br><br>
<input type = "text" placeholder = "Enter passport id" name = "passport"><br><br>
<label><?php echo 'Flight Number : '.$Flight_id; ?></label><br><br>
<label><?php echo 'Seats : '.$seats ?></label><br><br>
<input type = "text" placeholder = "Date of birth (YYYY-MM-DD)" name = "dob"><br><br>
<input type = "submit" name = "bookseat" value = "Book"><br><br>
</form>
</div></center>
</body>
</html>