-
Notifications
You must be signed in to change notification settings - Fork 0
/
checkin.php
74 lines (62 loc) · 2.29 KB
/
checkin.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
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<link href='https://fonts.googleapis.com/css?family=Allura' rel='stylesheet'>
<link rel="icon" href="iconfood.jpg" type="image/png">
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
<style type="text/css">
body {
margin: 0;
color: azure;
background-image: url("bg1.jpg");
height: 100%;
background-position: center;
background-repeat: no-repeat;
background-size: cover;
font-family: 'Allura';
font-weight: bold;
font-size: 38px;
border-image-width: auto;
}
.other{
font-size: 70px;
}
.w3-button {width:180px;}
</style>
</head>
<body>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "root";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$ingredient1 = $_POST['ingredient1'];
$ingredient2 = $_POST['ingredient2'];
$ingredient3 = $_POST['ingredient3'];
$query = "select * from myfood where ing1 = '$ingredient1' and ing2 = '$ingredient2' or ing1 = '$ingredient1' and ing2 = '$ingredient3' or ing1 = '$ingredient3' and ing2 = '$ingredient2' or ing1 = '$ingredient2' and ing2 = '$ingredient3' or ing1 = '$ingredient2' and ing2 = '$ingredient1' or ing1 = '$ingredient3' and ing2 = '$ingredient1'";
$resultSet = $conn->query($query);
if($resultSet->num_rows > 0){
while($row = $resultSet->fetch_assoc()) {
echo " Dish Name: " . $row["dishname"]. "<br>" . "Recipe:" . "<br>" . $row["process"] . "<p>". "<br>" ;
}
} else {
echo "<p class='other'>0 results found!"."<br><br><br><br>" . "</p>";
}
$conn->close();
?>
<div class="w3-container">
<nav class="menu">
<center><a href="generate.html"><button class="w3-button w3-light-blue w3-round-large">Back</button></a>
<a href="logout.php"><button class="w3-button w3-light-blue w3-round-large">Sign Out</button></a></center>
</ul>
</nav>
</div>
</body>
</html>