LPDLIS/tp-bd-files/webapp/helpdesk/do_helpdesk.php

25 lines
670 B
PHP
Raw Normal View History

2023-01-04 15:13:50 +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');
?>