Delete remAnimal.php

parent 40f9781f
<html>
<head>
<title>Exercice</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<?php
$vHost = 'tuxa.sme.utc';
$vPort = '5432';
$vData = 'dbbdd0p117';
$vUser = 'bdd0p117';
$vPass = 'LpIHl1sZ';
$vConn = new PDO("pgsql:host=$vHost;port=$vPort;dbname=$vData", $vUser, $vPass);
$idAnimal = $_POST['idAnimal'];
//TODO Valider que l'id reçu existe
if($idAnimal != ""){
$vSql ="DELETE FROM ANIMAL WHERE idAnimal='$idAnimal';";
$vSt = $vConn->prepare($vSql);
$vSt->execute();
header('Location: http://tuxa.sme.utc/~bdd0p117/animal.php');
}else
echo "Il manque une donnée";
?>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment