diff --git a/html/upload.php b/html/upload.php index bc6ac519..a45f0f0f 100644 --- a/html/upload.php +++ b/html/upload.php @@ -7,11 +7,11 @@ if(isset($_SESSION['userid']) == false) { die(); } -if(isset($_POST['title']) && isset($_FILES['file'])) { +if(isset($_POST['title'])) { $filename = date("YmdHis"); $destination = "../content/journal/" . $filename; $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); - $upload = $bdd->prepare("INSERT INTO articles ID, titre, date, auteur VALUES (:filename, :titre, :date, :auteur)"); + $upload = $bdd->prepare("INSERT INTO (articles ID, titre, date, auteur) VALUES (:filename, :titre, :date, :auteur)"); $upload->bindParam(':filename', $filename); $upload->bindParam(':titre', htmlspecialchars($_POST['titre'])); $upload->bindParam(':auteur', $_SESSION['display_name']);