Created
March 29, 2020 06:01
-
-
Save bharathraj-e/ebb86a460f2ffcfd421c90ccff249420 to your computer and use it in GitHub Desktop.
Check request and finalize response
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 | |
function err($err) | |
{ | |
$res['state'] = false; | |
$res['err'] = $err; | |
echo json_encode($res); | |
die(); | |
} | |
function check($query, $err) | |
{ | |
if (!isset($_REQUEST[$query])) { | |
err($err); | |
} | |
} | |
function complete($data) | |
{ | |
$res['state'] = true; | |
$res['data'] = $data; | |
echo json_encode($res); | |
die(); | |
} | |
$data = array(); | |
extract($_REQUEST); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment