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