You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
356 B
PHP
16 lines
356 B
PHP
<?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]);
|