Skip to content

Instantly share code, notes, and snippets.

@DerexScript
Created May 20, 2022 05:38
Show Gist options
  • Save DerexScript/c0c472d231059a97076475ddfcf0d929 to your computer and use it in GitHub Desktop.
Save DerexScript/c0c472d231059a97076475ddfcf0d929 to your computer and use it in GitHub Desktop.
login.php
<?php
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST, GET, DELETE, PUT, PATCH, OPTIONS');
header('Content-type: application/json');
if (isset($_POST['user']) && isset($_POST['password'])) {
$jsonArr = ["status" => "true", "POST" => $_POST];
echo json_encode($_POST);
} else {
$jsonArr = ["status" => "false", "POST" => $_POST, "error" => "request invalid"];
echo json_encode($_POST);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment