parent
8cc24b0642
commit
edc6d94c2b
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
$mysqli = require __DIR__ . "/database.php";
|
||||||
|
|
||||||
|
$sql = sprintf("SELECT * FROM user WHERE email = '%s'", $mysqli->real_escape_string($_GET["email"]));
|
||||||
|
|
||||||
|
$result = $mysqli->query($sql);
|
||||||
|
|
||||||
|
$is_available = $result->num_rows === 0;
|
||||||
|
|
||||||
|
header("Content-Type: application/json");
|
||||||
|
|
||||||
|
echo json_encode(["available" => $is_available]);
|
||||||
|
|
||||||
|
?>
|
||||||
Loading…
Reference in new issue