LPCyber/tp5-files/webapp/clients/do_message.php
Francois Lesueur 35d3ab5f34 tp5 bd
2022-03-24 08:31:23 +01:00

20 lines
460 B
PHP
Executable File

<?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');
?>