diff --git a/html/editpage.php b/html/editpage.php index 78c72a25..3485c671 100644 --- a/html/editpage.php +++ b/html/editpage.php @@ -51,6 +51,18 @@ if(isset($fichier)) { if(isset($_POST['page-content'])) { file_put_contents($fichier, nl2br($_POST['page-content'])); } + if(isset($_POST['classification'])&& isset($_GET['article'])) { + $bdd = connect($dbhost, $dbname, $dbuser, $dbpass); + + $req = $bdd->prepare("UPDATE articles SET classification = :classification WHERE ID = :article"); + $req->bindParam(':classification', $_POST['classification']); + $req->bindParam(':article', $_GET['article']); + if($req->execute()) { + $status = "Informations mises à jour"; + } else { + $status = "Erreur SQL"; + } + } $contenu = file_get_contents($fichier); } @@ -116,7 +128,20 @@ if(isset($fichier)) { echo "
Retour
"; echo "
"; echo '
"; echo "

" . $filename . "

"; echo '
';