Originariamente inviato da Shores
Per evitare spazi bianchi iniziali e finali puoi scrivere:

$_POST["nome"] = trim(strip_tags($_POST["nome"]));
$_POST["email"] = trim(strip_tags($_POST["email"]));
$_POST["url"] = trim(strip_tags($_POST["url"]));
$_POST["citta"] = trim(strip_tags($_POST["citta"]));
$_POST["messaggio"] = trim(strip_tags($_POST["messaggio"]));

Mentre per controllare ogni valore:

$errore=false;

Poi ripeti questa parte per ogni campo:

if (isset($_POST["nome"])):
if ($_POST["nome"]==""):
$errore=true;
endif;
else:
$errore=true;
endif;

poi se $errore è false è tutto ok, altrimenti c'è stato un errore.

Ciao!
Non mi funziona,

ho inserito tutto questo

$_POST["nome"] = trim(strip_tags($_POST["nome"]));
$_POST["email"] = trim(strip_tags($_POST["email"]));
$_POST["url"] = trim(strip_tags($_POST["url"]));
$_POST["citta"] = trim(strip_tags($_POST["citta"]));
$_POST["messaggio"] = trim(strip_tags($_POST["messaggio"]));


$errore=false;
if (isset($_POST["nome"])):
if ($_POST["nome"]==""):
$errore=true;
endif;
else:
$errore=true;
endif;

ho poi disinserito JS con questa url
javascript:void(document.mioform.onsubmit=null)

e ho cliccato su invia senza compilare il form, è partito il messaggio in bianco.