-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeletUser.php
More file actions
51 lines (31 loc) · 1.12 KB
/
deletUser.php
File metadata and controls
51 lines (31 loc) · 1.12 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
$idUser=$_GET['user'];
$server='localhost';
$db='trello';
$login='root';
$mdp='';
// connection alabdd
try {
$linkpdo = new PDO("mysql:host=$server;dbname=$db", $login, $mdp); //chemin de la base de données a ajouter avec login et mdp
}catch (Exception $e) {
die('Erreur : '.$e->getMessage());
}
?>
<script type="text/javascript">
if (confirm("Etes vous sur de vouloir surpimer la participation de l'utilisateur à ce concour ? ")) {
<?php
$req= $linkpdo -> prepare('select id from user where id like :idUser');
$req -> execute(array('idUser'=> $idUser ));
$id = $req-> fetch();
$id = $id[0];
$req = $linkpdo -> prepare('delete from participe where idUser like :idUser');
$req-> execute(array('idUser' => $idUser));
$req = $linkpdo -> prepare('delete from participe where idUser like :idUser');
$req-> execute(array('idUser' => $idUser));
?>
document.location.href="http://localhost/scan/compteAdmin.php";
} else {
document.location.href="http://localhost/scan/compteAdmin.php";
}
</script>
?>