Salve a tutti,
con questa form
utenti_ins
<form action="utenti_ins2.php" method="post" name="form" onSubmit="return validateForm(this);">
<input name="cognome" type="text" id="cognome" size="20" maxlength="18">
<input name="nome" type="text" size="20" maxlength="18">
<input name="username" type="text" id="username" size="20" maxlength="10">
<input name="submit" type=submit value="continua">
</form>
file utenti_ins2
Codice PHP:
$query = mysql_query("INSERT INTO utenti (cognome,nome,username) VALUES ('$cognome','$nome','$username')");
che mi salva i dati in una tabella
vorrei che al submit della form se l'username è gia presente nella tabella mi lanciasse un messaggio del tipo (ATTENZIONE L'UTENTE E' GIA PRESENTE IN ARCHIVIO) senza effettuare il submit e dandomi la possibilità di cambiare il nome dell'username.