LPDLIS/tp-bd-files/webapp/clients/do_message.php
Francois Lesueur 2d38bac294 bootstrap
2023-01-04 15:13:50 +01:00

20 lines
460 B
PHP

<?php
// ob_start();
session_start();
require_once("../db.inc.php");
// Gestion des modifications
if (isset($_POST['message'])) { // Ajout du message dans la BD
$message=$_POST['message'];
$login=$_SESSION['login'];
$query = "UPDATE clients SET message='$message' WHERE name='$login'";
pg_query($dbconn, $query) or die('Échec de la requête : ' . pg_last_error());
}
// Ferme la connexion
pg_close($dbconn);
header('Location: print_clients.php');
?>