Created
November 8, 2010 17:31
-
-
Save eurica/667972 to your computer and use it in GitHub Desktop.
the minimum viable raplet
This file contains hidden or 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 | |
/* | |
David Hayes [email protected] | |
Quasi-minimal viable Raplet: | |
// */ | |
$in = $_GET; //[email protected]&name=Rahul%20Vohra&twitter_username=rahulvohra&callback=jsonp123456789 | |
$jsonContainer = $in['callback']; | |
//It's nice to see what's going on, this is optional : | |
$er = error_reporting(); error_reporting(0); //Suppress errors, JSON doesn't show them | |
$fp = fopen('.log', 'a+'); //On apache .filenames are hidden by default :) | |
fwrite($fp, "\n\n".date('l jS \of F Y h:i:s A')."\n"); | |
fwrite($fp, print_r($in,true)); | |
fclose($fp); | |
error_reporting($er); | |
$html = "Hello World: ".$in['email']; | |
$css = ""; | |
$js = ""; | |
?> | |
<?= $jsonContainer ?> ({ | |
"html": "<?= $html ?>", | |
"css": "<?= $css ?>", | |
"js": "<?= $js ?>", | |
"status": 200 | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment