Io direi che sarà meglio aggiungere anche $_POST['nome'] dato che se hai register_globals a off allora nn adnrebbe.

se hai dunque:
trim(nome)

metti:
trim($_POST['nome'])