LPCyber/tp5-files/webapp/clients/do_message.php

20 lines
460 B
PHP
Raw Permalink Normal View History

2022-03-24 08:31:23 +01:00
<?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');
?>