Created
October 9, 2010 19:51
-
-
Save edorcutt/618544 to your computer and use it in GitHub Desktop.
Kynetx Remote Annotation Web Service from Kynetx Annotate V 2.0 http://k-docs.s3.amazonaws.com/Annotate%20V%202.pdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Kynetx Remote Annotation Web Service | |
* from Kynetx Annotate V 2.0 | |
* http://k-docs.s3.amazonaws.com/Annotate%20V%202.pdf | |
* by Ed Orcutt | |
*/ | |
// get the incoming annotate data | |
$json_request = $_GET['annotatedata']; | |
// call function to strip slashes if magic_quotes php.ini Directive is On | |
$json_decoded = json_decode(stripslashes($json_request)); | |
$toReturn = array(); | |
$count = 0; | |
//error_log(print_r($json_request)); | |
//error_log(print_r($json_decoded)); | |
foreach($json_decoded as $key => $item){ | |
if ($item->domain == 'www.enterprise.com') { | |
$toReturn[$key] = array('discount' => 'Enterprise Discount 35%'); | |
} | |
if ($item->domain == 'www.hertz.com') { | |
$toReturn[$key] = array('discount' => 'Hertz Discount 35%'); | |
} | |
$count++; | |
} | |
$callback = $_GET['jsoncallback']; | |
if($callback){ | |
echo $callback.'('.json_encode($toReturn).');'; | |
} else { | |
echo json_encode($toReturn); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment