From 73a9910e575c451c698d304ea563bc1fddcf5b7a Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Thu, 7 Mar 2024 17:47:32 +0000 Subject: [PATCH] Update file upload.php --- html/upload.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/html/upload.php b/html/upload.php index 4e5c3ed4..b9c14333 100644 --- a/html/upload.php +++ b/html/upload.php @@ -12,10 +12,10 @@ if(isset($_SESSION['userid']) == false) { if(isset($_POST['page-content'])) { $filename = rand(100000, 999999); - while(file_exists($repertoire . "content/journal" . $filename . ".md")) { + while(file_exists($repertoire . "content/journal/" . $filename . ".md")) { $filename = rand(100000, 999999); } - file_put_contents($repertoire . "content/journal" . $filename . ".md", nl2br($_POST['page-content'])); + file_put_contents($repertoire . "content/journal/" . $filename . ".md", nl2br($_POST['page-content'])); $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); $upload = $bdd->prepare("INSERT INTO articles (ID, titre, date, auteur) VALUES (:filename, :titre, :date, :auteur)");