forked from Bunkermaster/crud-webp2020-g1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete.php
37 lines (37 loc) · 762 Bytes
/
delete.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
if (!isset($_GET['id'])) {
header('Location: index.php?error=noidprovideddelete');
exit;
}
require_once "connexion.php";
$requete = "SELECT
`id`,
`nom`,
`marque`
FROM
`garage`
WHERE
`id` = :id
;";
$stmt = $conn->prepare($requete);
$stmt->bindValue(':id', $_GET['id']);
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>T'es sur?</title>
</head>
<body>
<?php
require "header.php";
?>
<form action="dodelete.php" method="post">
<input type="hidden" name="id" value="<?=$row['id']?>">
<label for="">T'es sur de vouloir supprimer <?=$row['nom']?></label><br>
<input type="submit" value="Je suis certain! OUIIII!">
</form>
</body>
</html>