This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdelete_recipe.php
72 lines (53 loc) · 1.8 KB
/
delete_recipe.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
<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<title>Verify Insert</title>
<link rel="stylesheet" type="text/css" href="CSS/main.css">
</head>
<body>
<p>
<ul class = "topnav">
<li><a href = "index.html">Home</a></li>
<li class ="dropdown">
<a href="javascript:void(0)" class="dropbtn">View Recipes</a>
<div class="dropdown-content">
<a href = "all_recipes.php">View All Recipes</a>
<a href = "select_recipes_first.php">View Selected Recipe</a>
</div>
</li>
<li class ="dropdown">
<a href="javascript:void(0)" class="dropbtn">Recipes</a>
<div class="dropdown-content">
<a href = "select_ingredients.php">Insert Recipe</a>
<a href = "delete_select_recipe.php">Delete Recipe</a>
</div>
</li>
<li>
<li class ="dropdown">
<a href="javascript:void(0)" class="dropbtn">Ingredients</a>
<div class="dropdown-content">
<a href = "create_ingredients.html">Insert Ingredient</a>
<a href = "delete_select_ingredients.php">Delete Ingredients</a>
</div>
</li>
<li><a href = "about.html">About</a></li>
<li><a href = "future.html">Upcoming</a></li>
</ul>
<?php
@ $db = mysql_pconnect("localhost","steph","secret");
if (!$db)
{
echo "ERROR: Could not connect to database. Please try again later.";
exit;
}
mysql_select_db("webproj");
$recipeid = $_POST['recipe'];
$query = "delete from recipe_ingredients where recipe_id = ".$recipeid."";
$result = mysql_query($query);
$query = "delete from recipes where recipe_id = ".$recipeid."";
$result = mysql_query($query);
if ($result) echo "<p> 1 recipe deleted</p>";
?>
</body>
</html>