-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdeletefavourite.php
More file actions
44 lines (27 loc) · 813 Bytes
/
deletefavourite.php
File metadata and controls
44 lines (27 loc) · 813 Bytes
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
<?php
if (isset($_GET['info'])) {
$endp = "http://cmcgee17.lampt.eeecs.qub.ac.uk/gameAPI/index.php?favourites&api_k=RpUSEnXg4BOI1I9f7hDV";
$user = "cmcgee480";
$pw = "Mus1c5020";
$opts = array(
'http' => array(
'method' => "GET",
'header' => "Authorization: Basic " . base64_encode("$user:$pw")
)
);
$context = stream_context_create($opts);
$res = file_get_contents($endp, false, $context);
$gamedata = json_decode($res, true);
foreach ($gamedata as $value) {
include("conn.php");
$gameID = $_GET['info'];
$sql = "DELETE FROM practice_favouritestable WHERE gameID = '$gameID'";
$result = $conn->query($sql);
if (!$result) {
echo $conn->error;
}else{
header("Location: http://cmcgee17.lampt.eeecs.qub.ac.uk/doubletap/deleteupload.php");
}
}
}
?>