<?php
// check_email.php
include "../db/connection.php"; // your DB connection

$email = trim($_POST['email'] ?? '');
$mobile = trim($_POST['mobile'] ?? '');

if (empty($email)) {
    echo 'INVALID';
    exit;
}
if (empty($mobile)) {
    echo 'INVALID';
    exit;
}

// Check if email exists


        
$sql = "SELECT id FROM user_signin WHERE delete_status='0' AND (user_mailid = ? OR user_mobile = ?)";
$stmt = $conn->prepare($sql);
$stmt->bind_param("ss", $email, $mobile);
$stmt->execute();
$stmt->store_result();

if ($stmt->num_rows > 0) {
    echo 'EXISTS';
} else {
    echo 'OK';
}
$stmt->close();
$conn->close();
?>