-
Notifications
You must be signed in to change notification settings - Fork 0
/
delete.php
33 lines (30 loc) · 916 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
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
<?php
if (isset($_GET['delete_id']) && is_numeric($_GET['delete_id'])) {
try {
$bdd = new PDO('mysql:host=localhost;dbname=maxime', 'maxime', 'maxime');
} catch (Exception $e) {
die('Erreur : ' . $e->getMessage());
}
$req = $bdd->prepare("DELETE from user WHERE idUser = '".$_GET['delete_id']."'");
$req->execute() or die(print_r($req->errorInfo()));?>
<script type="text/javascript">
<!--
window.location = "http://localhost/TP2/view.php"
//-->
</script>
<?php
}
?>
</body>
</html>