17 lines
408 B
PHP
17 lines
408 B
PHP
<?php
|
|
header("Content-Type: text/plain"); // Assure un bon retour texte brut
|
|
require_once __DIR__ . '/../includes/bootstrap_global.php';
|
|
|
|
if (isset($_POST['email'])) {
|
|
$email = trim($_POST['email']);
|
|
|
|
$stmt = $pdo->prepare("SELECT id FROM compte WHERE email = :email");
|
|
$stmt->execute(['email' => $email]);
|
|
|
|
echo($stmt->fetch()) ? "existe" : "disponible";
|
|
exit;
|
|
}
|
|
|
|
echo "invalide";
|
|
exit;
|