25 lines
No EOL
528 B
PHP
25 lines
No EOL
528 B
PHP
<?php
|
|
require_once(__DIR__."/jsonBuilder.inc.php");
|
|
|
|
function respondJson(JsonBuilder $builder) {
|
|
header('Content-type: application/json');
|
|
echo($builder->getJson());
|
|
}
|
|
|
|
function respondHtml(string $html) {
|
|
print($html);
|
|
}
|
|
|
|
function respondStatus(int $statusCode, string $message = "") {
|
|
http_response_code($statusCode);
|
|
die($message);
|
|
}
|
|
|
|
function redirectBack() {
|
|
header("Location: {$_SERVER['HTTP_REFERER']}");
|
|
}
|
|
|
|
function redirectTo($url) {
|
|
header("Location: {$url}");
|
|
}
|
|
?>
|