-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess.php
More file actions
28 lines (27 loc) · 1.31 KB
/
process.php
File metadata and controls
28 lines (27 loc) · 1.31 KB
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
<link href="style.css" rel="stylesheet" type="text/css"/>
<?php
require 'dbConnect.php';
session_start();
$title = stripslashes($_REQUEST['title']);
$title = mysqli_real_escape_string($conn, $title);
//$description = stripslashes($_REQUEST['description']);
//$description = mysqli_real_escape_string($conn, $description);
$ingredients = stripslashes($_REQUEST['ingredients']);
$ingredients = mysqli_real_escape_string($conn, $ingredients);
$instructions = stripslashes($_REQUEST['instructions']);
$instructions = mysqli_real_escape_string($conn, $instructions);
if(isset($_POST['submit'])){
$title= $_POST['title'];
echo "Title: " .$title . "<br />";
//$description = $_POST['description'];
//echo "Description: " .$description . "<br />";
$ingredients = $_POST['ingredients'];
echo "Ingredients: " .$ingredients . "<br />";
$instructions = $_POST['instructions'];
echo "Instructions: ".$instructions."<br />";
}
$query = "INSERT INTO recipeTable(title,ingredients,instructions) VALUES ('$title', '$ingredients','$instructions')";
$result = mysqli_query($conn, $query);
echo "Your recipe was added - check it out on the database.";
?>
<p><button onclick="location.href='main.php'">Main</button></p>