Last active
March 21, 2021 14:52
-
-
Save dreambo4/f3063105af519e0849db0f775f24b749 to your computer and use it in GitHub Desktop.
給 APP 練習用 - POST
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 | |
header('Content-Type: application/json; charset=utf-8'); | |
$account = $_POST['account']; | |
$password = $_POST['password']; | |
$name = $_POST['name']; | |
$name = (!isset($name) || empty($name)) ? "" : $name; | |
$json = array(); | |
if ($account == "cmrdb" && $password == "20210323"){ | |
$json = array( | |
'message' => "Login Success!", | |
'name' => $name, | |
'success' => 1 | |
); | |
} else { | |
$json = array( | |
'name' => $name, | |
'message' => "Login Failed!", | |
'success' => -1 | |
); | |
} | |
print(json_encode($json)); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment