forked from 07sumit1002/CabRental
-
Notifications
You must be signed in to change notification settings - Fork 0
/
anonimous.php
27 lines (26 loc) · 854 Bytes
/
anonimous.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
<?php
error_reporting(0);
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "carpool1";
$conn = mysqli_connect($servername,$username,$password,$dbname);
// if($conn){
// echo "Connected";
// }
if($_POST['submit']){
$loc = $_POST['search'];
$tm = $_POST['tim'];
$dt = $_POST['dat'];
$query="INSERT INTO anoni(locat,dat,tim)
VALUES('$loc','$dt','$tm');";
$data=mysqli_query($conn,$query);
if($data){
echo "<script>alert('Data inserted succesfully')</script>";
echo"<meta http-equiv = 'refresh' content = '0; url = http://localhost/Project2/Carpool/index.html'>";
}
else{
echo "<script>alert('Data insertion failed')</script>";
}
}
?>