mirror of
https://github.com/WebStackPage/WebStackPage.github.io.git
synced 2026-02-06 20:03:25 +08:00
25 lines
422 B
PHP
Executable File
25 lines
422 B
PHP
Executable File
<?php
|
|
|
|
header('Content-Type: application/json');
|
|
|
|
#$errors = mt_rand(0,100)%2==0; // Random response (Demo Purpose)
|
|
$errors = false;
|
|
|
|
|
|
$resp = array(
|
|
);
|
|
|
|
# Normal Response Code
|
|
if(function_exists('http_response_code'))
|
|
http_response_code(200);
|
|
|
|
# On Error
|
|
if($errors)
|
|
{
|
|
if(function_exists('http_response_code'))
|
|
http_response_code(400);
|
|
|
|
$resp['error'] = "Couldn't upload file, reason: ~";
|
|
}
|
|
|
|
echo json_encode($resp); |