Commit 4fb2d6cb authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Add json_reply() function

parent 6f224c20
......@@ -534,6 +534,16 @@ function json_headers() {
header('Pragma: no-cache');
}
/**
* This function sends a JSON message.
*
*/
function json_reply($type, $message) {
json_headers();
echo json_encode(array('error' => $type, 'message' => $message));
exit;
}
/**
* This function returns a GET or POST parameter with optional default. If the
* default isn't specified and the parameter hasn't been sent, a
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment