Created
January 31, 2018 15:45
-
-
Save AlexisTM/7d4cc01d7e125b34868ad55f99314845 to your computer and use it in GitHub Desktop.
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 | |
include 'json.php'; | |
function cache_get($key) { | |
@include "/tmp/$key"; | |
return isset($val) ? $val : false; | |
} | |
$response = new \Simple\json(); | |
if(isset($_POST["name"])){ | |
$name = $_POST["name"]; | |
} else if(isset($_GET["name"])) { | |
$name = $_GET["name"]; | |
} else { | |
$response->success = False; | |
$response->send(); | |
exit(); | |
} | |
$data = cache_get($name); | |
$response->name = $name; | |
$response->data = $data; | |
$response->send(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment