LPCyber/tp5-files/webapp/helpdesk/do_helpdesk.php

25 lines
670 B
PHP
Raw Normal View History

2022-03-24 08:31:23 +01:00
<?php
session_start();
ob_start();
echo "Login is ". $_SESSION['login'];
echo "&nbsp;<a href=login.php?logout=1>Logout</a><br/><br/>";
require_once("../db.inc.php");
// Gestion des modifications
if (isset($_POST['name'])) { // Modification d'un client existant
$name=$_POST['name'];
$email=$_POST['email'];
$comment=$_POST['comment'];
$id=$_POST['id'];
$message=$_POST['message'];
$query = "UPDATE clients SET name='$name',email='$email',comment='$comment',message='$message' WHERE id='$id'";
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');
?>