-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdataInput.php
More file actions
19 lines (17 loc) · 838 Bytes
/
dataInput.php
File metadata and controls
19 lines (17 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<?php
require_once("connection.php");
if(isset($_POST["Titre"],$_POST["Prix"],$_POST["DateDeSortie"],$_POST["Genre"],$_POST["Origine"],$_POST["Mode"],$_POST["Connexion"])){
$Titre = $_POST["Titre"];
$Prix = $_POST["Prix"];
$DateDeSortie = $_POST["DateDeSortie"];
$Genre = $_POST["Genre"];
$Origine = $_POST["Origine"];
$Mode = $_POST["Mode"];
$Connexion = $_POST["Connexion"];
$PlateformeArray = $_POST["Plateforme"];
$Plateforme = implode(",", $PlateformeArray);
$sql = "INSERT INTO `jeuxvideo`(`Id`, `Titre`, `Prix (Euros)`, `Date de Sortie`, `Genre`, `Origine`, `Mode`, `Connexion`, `Plateforme`) VALUES (NULL,'".$Titre."','".$Prix."','".$DateDeSortie."','".$Genre."','".$Origine."','".$Mode."','".$Connexion."','".$Plateforme."')";
$add = $conn->prepare($sql);
$add->execute();
header('Location: index.php');
}