Ciao ragazzi

ho creato un cookie ma mi da questo errore:
Warning: Cannot modify header information - headers already sent by (output started at

questo è il codice:

Codice PHP:
   if (mysql_query($query$db) and ($utente==$nome))    {            echo "Benvenuto, [b]$nome[/b],Ora potrai acquistare i nostri prodotti";     setcookie("nome",$nometime()+3600);     $ciao=$_COOKIE["nome"];     echo "cookie:$ciao";    } 
grazie anticipatamente per l'aiuto