forked from kalyanm72/Online-Bus-Booking
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbussignup.php
More file actions
78 lines (56 loc) · 982 Bytes
/
Copy pathbussignup.php
File metadata and controls
78 lines (56 loc) · 982 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
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
<?php
$con=mysqli_connect("localhost","root","","bus_ticket");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$pid='';
$name='';
$mob='';
$email='';
//$password='';
if (isset($_POST['pid']))
{
$pid=$_POST['pid'];
}
if (isset($_POST['name']))
{
$name=$_POST['name'];
}
if (isset($_POST['mob']))
{
$mob=$_POST['mob'];
}
if (isset($_POST['email']))
{
$email=$_POST['email'];
}
// if (isset($_POST['password']))
// {
// $password=$_POST['password'];
// }
$sqll="select pid from passenger";
$retval=mysqli_query($con,$sqll);
$flag=1;
if($flag==1)
{
while($row=mysqli_fetch_array($retval))
{
if($pid==$row['pid'])
{
header("Location:index1.html");
}
}
}
if($flag==1){
$sql="INSERT INTO user(pid,name,mob,email)
VALUES ('$pid','$name','$mob','$email')";
if (!mysqli_query($con,$sql))
{
die('Error: ' . mysqli_error($con));
}
}
header("Location:index1.html");
mysqli_close($con);
?>