-
Notifications
You must be signed in to change notification settings - Fork 0
/
remove-engine.php
37 lines (20 loc) · 986 Bytes
/
remove-engine.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($_COOKIE['log-id-cookie'])) && $_COOKIE['log-statue-cookie'] == 1) {
$id = $_COOKIE['log-id-cookie'];
$title = $_POST['title-remove'];
$connect=mysql_connect("magic.philosophy.ubc.ca", "root", "PhiloMagic2015!") or die(mysql_error());
mysql_select_db("whately", $connect) or die(mysql_error());
// check connection
if (mysqli_connect_errno()) {
printf("Connect failed: %s\n", mysqli_connect_error());
exit();
}
$qu = "SET NAMES 'utf8'";
mysql_query($qu, $connect);
//$query = "SELECT `graph`, `title` FROM `graph` WHERE (`id`='$id')";
$query = "DELETE FROM `graph` WHERE `id`='$id' AND `title`='$title'";
mysql_query($query, $connect);
setcookie('remove-graph-cookie', 1, time() + 10, '/');
echo "<script>window.location.href='http://magic.philosophy.ubc.ca/argumentMapping/graph.php';</script>";
}
?>