forked from abhii14758/QR-code-based-feedbackform
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathform.php
40 lines (30 loc) · 1.05 KB
/
form.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
<?php
$insert = false;
if(isset($_POST['Question-1'])){
$server = "localhost";
$username = "root";
$password = "";
$dbname = "feedback";
$con = mysqli_connect($server, $username, $password, $dbname);
if(!$con)
{
die("Database not connected due to ".mysqli_connect_error());
}
//echo "Sucess connecting Database";
$Station = $_POST['Station'];
$question_1 = $_POST['Question-1'];
$question_2 = $_POST['Question-2'];
$question_3 = $_POST['Question-3'];
$question_4 = $_POST['Question-4'];
$sql = "INSERT INTO `feedback`. `feedback` (`Station`,`Question1`, `Question2`, `Question3`, `Question4`, `dt`) VALUES ('$Station','$question_1', '$question_2', '$question_3','$question_4', current_timestamp());";
if($con->query($sql)== true){
//echo "Sucessfully inserted";
}
else{
echo "Error: $sql </br> $con->error ";
}
$con->close();
// header("Location: pop.html");
echo '<script>window.location="pop.html"</script>';
}
?>