<?php 
require('config.php');
sleep(1);
if (isset($_POST)) {
    $username = (string)$_POST['name'];
    
    $result = $connexion->query(
        'SELECT * FROM user WHERE name like "'.strtolower($username).'"'
    );
    
    if ($result->num_rows > 0) {
        echo '<div class="alert alert-warning"><strong>Alerta!</strong> Cliente registrado anteriormente.</div>';
    } else {
        echo '<div class="alert alert-success"><strong>Éxito!</strong> Cliente disponible para registro.</div>';
    }
}