summaryrefslogtreecommitdiffstats
path: root/ajax
diff options
context:
space:
mode:
authorPatrick Davison <snapwilliam@gmail.com>2013-03-10 17:49:00 -0700
committerPatrick Davison <snapwilliam@gmail.com>2013-03-10 17:49:00 -0700
commit5f1f9c14ff60b8ae26edbd6a819c5d159da0026d (patch)
treef7ea927bb5d587aa615959a3ed56d8385dfd2509 /ajax
parent8cc65436b7d5552af54c8d93feed85f63ad7fa4e (diff)
downloadpathery-5f1f9c14ff60b8ae26edbd6a819c5d159da0026d.tar.xz
Retrieve solution.
Diffstat (limited to 'ajax')
-rw-r--r--ajax/misc.ajax.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/ajax/misc.ajax.php b/ajax/misc.ajax.php
new file mode 100644
index 0000000..64eeccc
--- /dev/null
+++ b/ajax/misc.ajax.php
@@ -0,0 +1,23 @@
+<?
+ob_start("ob_gzhandler");
+
+if ($_GET[r] == 'solution') {
+ solutionRespond();
+ exit;
+}
+
+function solutionRespond() {
+ session_start();
+ session_write_close();
+ if ($_SESSION['accepted'] != 1) exit;
+ include_once('../includes/maps.php');
+
+ $userID = $_SESSION['userID'];
+ $mapID = $_GET['mapid'] * 1;
+ if (!is_int($mapID)) exit;
+ $solution = getSolution($userID, $mapID);
+ echo json_encode($solution);
+ exit;
+}
+
+?> \ No newline at end of file