-
Notifications
You must be signed in to change notification settings - Fork 0
/
air.php
50 lines (44 loc) · 1.36 KB
/
air.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
<?php
session_start();
$pnr=mt_rand(10000,99999);
$_SESSION['pnr']=$pnr;
$servername='localhost';
$username='root';
$password='root';
$dbname = "mydb";
$conn=mysqli_connect($servername,$username,$password,"$dbname");
if(!$conn){
die('Could not Connect My Sql:' .mysql_error());
}
if(isset($_POST['save']))
{
$from=$_SESSION['f'];
$to=$_SESSION['t'];
$class=$_SESSION['c'];
$date=$_SESSION['d'];
$_SESSION['fname']=$_POST['fname'];
$_SESSION['lname']=$_POST['lname'];
$_SESSION['email']=$_POST['email'];
$_SESSION['phone']=$_POST['phone'];
$f_name=$_SESSION['fname'];
$l_name=$_SESSION['lname'];
$e_mail=$_SESSION['email'];
$p_hone=$_SESSION['phone'];
$flno="IX-1813";
$passno=$_POST['passpp'];
$passdate=$_POST['pexpiry'];
$address=$_POST['address'];
$city=$_POST['city'];
$pin=$_POST['pin'];
$sql = "INSERT INTO passengerinfo (fname,lname,passno,passdate,address,city,pin)
VALUES ('$f_name','$l_name','$passno','$passdate','$address','$city','$pin'); INSERT INTO ticketinfo (fname,lname,email,phone,depart,arrival,class,date,pnr,flno)
VALUES ('$f_name','$l_name','$e_mail','$p_hone','$from','$to','$class','$date','$pnr','$flno')";
if (mysqli_multi_query($conn, $sql)) {
header("Location: air2.php");
} else {
echo "Error: " . $sql . "
" . mysqli_error($conn);
}
mysqli_close($conn);
}
?>