php
<form method= »post » action= » »>
<label>Email :</label>
<input type= »email » name= »user_email » required>
<button type= »submit » name= »check_email »>
Continuer
</button>
</form>
<?php
// Si email envoyé
if (isset($_POST[‘check_email’])) {
$email = sanitize_email($_POST[‘user_email’]);
$user = get_user_by(’email’, $email);
if ($user) {
// Redirection selon email
if ($email === ‘client1@example.com’) {
wp_redirect(home_url(‘/login-client1/’));
exit;
}
if ($email === ‘client2@example.com’) {
wp_redirect(home_url(‘/login-client2/’));
exit;
}
// Par défaut
wp_redirect(home_url(‘/login-standard/’));
exit;
} else {
echo « <p style=’color:red;’>Email inconnu</p> »;
}
}
return ob_get_clean();
});
