cambia la tua funzione::
e poi richiamala così:Codice PHP:
function username($variabile){
$username = $variabile;
if($username == "")
return "Il campo non può essere lasciato vuoto";
$query = mysql_query("
SELECT id
FROM ".$_CONFIG['table_utenti']."
WHERE username='".$username."'");
if(mysql_num_rows($query) != 0)
return "Nome utente già utilizzato";
return true;
}
echo username($_POST['username'])