-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinserts.php
executable file
·82 lines (75 loc) · 3.1 KB
/
inserts.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
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
79
80
81
82
<!DOCTYPE html>
<html lang="en">
<style>
form{
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
</style>
<head>
<title>K17 Food Stall</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</head>
<body align="center">
<div class="container-fluid">
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="/k17/index.html">K17!! Food Stall</a>
</div>
<ul class="nav navbar-nav">
<li ><a href="/k17/index.html">Home</a></li>
<li><a href="#">Non-Veg Combo</a></li>
<li><a href="#">Veg Combo</a></li>
<li><a href="#">Fast Food</a></li>
<li><a href="/k17/food.html">Food For Thought</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/k17/admin.php"><span class="glyphicon glyphicon-send"></span> Admin</a></li>
<li><a href="/k17/register.php"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="/k17/index.php"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</nav>
</div>
<img src="/k17/img/ceg.png" alt="CEG Logo" height="100" width="100" align="left"><img src="/k17/img/k17.png" alt="CTF Logo" height="100" width="250" align="right">
<h1><p align="center" >Welcome to K17!! Food Stall</p></h1>
<br>
<br><hr>
<br><br>
<?php
/* Attempt MySQL server connection. Assuming you are running MySQL
server with default setting (user 'root' with no password) */
$link = mysqli_connect("localhost", "root", "root", "booking");
// Check connection
if($link === false){
die("ERROR: Could not connect. " . mysqli_connect_error());
}
// Escape user inputs for security
$first_name = mysqli_real_escape_string($link, $_POST['fname']);
$last_name = mysqli_real_escape_string($link, $_POST['lname']);
$email_address = mysqli_real_escape_string($link, $_POST['email']);
$va = mysqli_real_escape_string($link, $_POST['vai']);
$vaa = mysqli_real_escape_string($link, $_POST['vaii']);
$vaaa= mysqli_real_escape_string($link, $_POST['vaiii']);
$vaaaa = mysqli_real_escape_string($link, $_POST['vaiiii']);
// attempt insert query execution
$sql = "INSERT INTO `feedback`(`name`, `address`, `phone`, `email`, `star`, `good`, `bad`) VALUES ('$first_name', '$last_name', '$email_address','$va','$vaa','$vaaa','$vaaaa')";
if(mysqli_query($link, $sql)){
echo "<h1><div style='text-align:center'>Feedback Sent</h1></div>";
} else{
echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
// close connection
mysqli_close($link);
?>
<ul class="pager">
<li><a href="/k17/index.html">Previous</a></li>
</ul>
</body>
</html>