forked from bferster/VisualEyes-5
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathloaddata.php
More file actions
33 lines (28 loc) · 993 Bytes
/
Copy pathloaddata.php
File metadata and controls
33 lines (28 loc) · 993 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
<?php
header('Cache-Control: no-cache, no-store, must-revalidate');
header('Expires: Sun, 01 Jul 2005 00:00:00 GMT');
header('Pragma: no-cache');
require_once('config.php');
$id=addEscapes($_REQUEST['id']); // Get id
$kml=addEscapes($_REQUEST['kml']); // Get id
$query="SELECT * FROM qdata WHERE id = '".$id."'"; // Look for data
$result=mysql_query($query); // Run query
if (mysql_numrows($result)) { // If found,
$s=mysql_result($result,0,"data"); // Get data field
if ($kml) {
$s=str_replace("\\\"","\"",$s); // Unescape
print($s); // Send JSON
}
else
print("LoadUserData({ \"data\":\"$s\"})"); // Send JSONP
}
mysql_close(); // Close
function addEscapes($str) // ESCAPE ENTRIES
{
if (!$str) // If nothing
return $str; // Quit
$str=addslashes($str); // Add slashes
$str=str_replace("\r","",$str); // No crs
return $str;
}
?>