-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopen-engine.php
More file actions
43 lines (21 loc) · 842 Bytes
/
open-engine.php
File metadata and controls
43 lines (21 loc) · 842 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
<?php
if((isset($_COOKIE['log-id-cookie'])) && $_COOKIE['log-statue-cookie'] == 1) {
$id = $_COOKIE['log-id-cookie'];
$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')";
$result = mysql_query($query, $connect);
while($row = mysql_fetch_array($result))
{
$var[] = $row;
}
echo '{"graphs":'.json_encode($var).'}';
}
?>