<?php
include("configa.php");

$mobile = $_POST['mobile'] ?? '';

$response = ['exists' => false];

if (!empty($mobile)) {
    $mobile = mysqli_real_escape_string($conn, $mobile);
    $query = "SELECT id FROM login_gest WHERE mobile = '$mobile' LIMIT 1";
    $result = mysqli_query($conn, $query);
    if (mysqli_num_rows($result) > 0) {
        $response['exists'] = true;
    }
}

header('Content-Type: application/json');
echo json_encode($response);
?>
