Commit 4f4db46f authored by Raulin's avatar Raulin

maj ajout aliment

parent c479113a
...@@ -382,7 +382,7 @@ ...@@ -382,7 +382,7 @@
<input type="text" id="aliment" name="aliment" required> <input type="text" id="aliment" name="aliment" required>
</div> </div>
<div> <div>
<label>Type d'aliment : </label> <label>Type d'aliment </label>
<input type="text" id="cat" name="cat" required> <input type="text" id="cat" name="cat" required>
<!-- <select id="type" size="1"> <!-- <select id="type" size="1">
<option value="fruit"> Fruit </option> <option value="fruit"> Fruit </option>
......
<?php <?php
require_once("template.php");
if(isset($_POST["aliment"]) && isset($_POST["cat"])){ if(isset($_POST["aliment"]) && isset($_POST["cat"])){
$requete="INSERT INTO `ALIMENTS` (`ID_ALIMENT`,`NAME_ALIMENT`, `TYPE_ALIMENT`) VALUES (NULL, '" .$_POST['aliment'] . "', '" . $_POST['cat'] . "')"; $requete="INSERT INTO `ALIMENTS` (`ID_ALIMENT`,`NAME_ALIMENT`, `TYPE_ALIMENT`) VALUES (NULL, '" .$_POST['aliment'] . "', '" . $_POST['cat'] . "')";
...@@ -8,5 +9,4 @@ if(isset($_POST["aliment"]) && isset($_POST["cat"])){ ...@@ -8,5 +9,4 @@ if(isset($_POST["aliment"]) && isset($_POST["cat"])){
$msg="Il manque des informations"; $msg="Il manque des informations";
} }
echo json_encode($msg); echo $msg;
header("Location: aliment.php");
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment