-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreponse.php
25 lines (22 loc) · 837 Bytes
/
reponse.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
<?php
if (isset($_GET['ref_demande'])) {
$ref_demande = $_GET['ref_demande'];
try {
include 'db.php';
// Supprimer la demande d'ami
$stmt = $pdo->prepare("DELETE FROM demandes_ami WHERE ref_demande = :ref_demande");
$stmt->bindParam(':ref_demande', $ref_demande);
$stmt->execute();
if (isset($_GET['ip_add']) AND isset($_GET['token'])) {
$ip_add = $_GET['ip_add'];
$token = $_GET['token'];
header('Location: http://'.$ip_add.'/accepte2.php?ref_demande='.$ref_demande.'&token='.$token);
} if (isset($_GET['ip_add'])) {
$ip_add = $_GET['ip_add'];
header('Location: http://'.$ip_add.'/notif.php');
}
} catch(PDOException $e) {
echo "Connection failed: " . $e->getMessage();
}
}
?>