Ragazzi sto impazzendo!

Io prelevo dal seguente form una stringa:
Codice PHP:
<form action="priv.php" method="POST">
    
NomeU:
    <
input name="nomeU" value="" size="20">
    

    <
input type="submit" VALUE="Aggiorna">            
</
form
Dopodichè acquisisco nella priv.php e controllo se il campo è vuoto:

Codice PHP:
<?php    
$hostname
='localhost';
$username='root';
$passwd='';
$conn=mysql_connect($hostname,$username,$passwd);

$nomeU=$_POST['nomeU'];

if(
$nomeU=="")
{
    echo(
"<script> alert('Inserire l'username.') ; window.location.href='utenti.php'<script>");
}
E' come se non mi considerasse l'if. Anche perchè le operazioni dopo me le effettua.