Grazie per il precedente aiuto a RoTeam.
Sto programmando una pagina di registrazione. Ho un altro problema non mi compare, nonostante non abbia errori di campi mancanti, la scritta "Per completare la registrazione controlla la tua casella di posta elettronica e clicca sul link di attivazione" che è inserita nel codice.
Non riesco a trovare l'errore, potreste aiutarmi???

Ecco il codice:

Codice PHP:
<?php  

    
include 'header.php'
     
?> 
     
    <div id="wrapper"> 
     
    <?php  

        
if(!isset($_GET['passkey'])){ 
         
            if(!isset(
$_POST['invia'])){ ?> 
             
                <form method="post" action="#" id="formregistrazione" enctype="multipart/form-data"> 
                     
                    <ul> [*]<label for="nome">Nome</label> 
                            <input type="text" name="nome" id="nome" /> 
                         [*]<label for="cognome">Congnome</label> 
                            <input type="text" name="cognome" id="cognome" /> 
                         [*]<label for="compleanno">Data di nascita</label> 
                            <select name="giorno"> 
                                <option value="" disabled="disabled" selected="selected">Giorno:</option> 
                                <?php 
                                 
                                    
for($i=1;$i<=31;$i++){ ?> 
                                     
                                        <option value="<?php echo $i?>"><?php echo $i?></option> 
                                         
                                    <?php ?> 
                            </select> 
                            <select name="mese"> 
                                <option value="" disabled="disabled" selected="selected">Mese:</option> 
                                <?php 
                                 
                                    
for($i=1;$i<=12;$i++){ ?> 
                                     
                                        <option value="<?php echo $mesi[$i]; ?>"><?php echo $mesi[$i]; ?></option> 
                                         
                                    <?php ?> 
                             
                            </select> 
                            <select name="anno"> 
                                <option value="" disabled="disabled" selected="selected">Anno:</option> 
                                <?php 
                                 
                                    
for($i=1960;$i<=$annoattuale;$i++){ ?> 
                                     
                                        <option value="<?php echo $i?>"><?php echo $i?></option> 
                                         
                                    <?php ?> 
                             
                            </select> 
                         
                            <label for="password1">Password</label> 
                            <input type="password" name="password1" id="password1" /> 
                         [*] 
                            <label for="password2">Ripeti Password</label> 
                            <input type="password" name="password2" id="password2" /> 
                         [*] 
                            <label for="email">E-mail</label> 
                            <input type="text" name="email" id="email" /> 
                         [*] 
                            <label for="luogo">Luogo di nascita</label> 
                            <input type="text" name="luogo" id="luogo" /> 
                         [*] 
                            <label for="residenza">Dove vivi</label> 
                            <input type="text" name="residenza" id="residenza" /> 
                         [*]<label for="foto">Foto Profilo</label> 
                            <input type="file" name="foto" id="foto" /> 
                         [/list]
                        <input type="submit" name="invia" id="registrati" value="Registrati" /> 
                </form> 
             
    <?php    } else { 
                 
                
// creazione di un codice di conferma 
                
$codiceconferma md5(uniqid(rand())); 
                 
                
// Valori del form 
                
$nome mysql_real_escape_string($_POST['nome']); 
                
$cognome mysql_real_escape_string($_POST['cognome']); 
                
$giorno mysql_real_escape_string($_POST['giorno']); 
                
$mesi mysql_real_escape_string($_POST['mese']); 
                
$anno mysql_real_escape_string($_POST['anno']); 
                
$password1 mysql_real_escape_string($_POST['password1']); 
                
$password2 mysql_real_escape_string($_POST['password2']); 
                
$email mysql_real_escape_string($_POST['email']); 
                
$luogo mysql_real_escape_string($_POST['luogo']); 
                
$residenza mysql_real_escape_string($_POST['residenza']); 
                
$foto mysql_real_escape_string($_FILES["foto"]["name"]); 
             
                
// controllo campi vuoti e password 
                 
                
if($email == "" || $nome == "" || $cognome == "" || $giorno == "" || $mesi == "" || $anno == "" || $luogo == "" || $residenza == ""){ 
                    echo 
"Devi riempire tutti i campi"
                }elseif(
$password1 == "" || $password2 == ""){ 
                    echo 
"Devi riempire tutti i campi"
                }elseif(
$password2 != $password1){ 
                    echo 
"Le password devono coincidere"
                }else{ 
                     
113                   $recuperauseremail mysql_query("SELECT id FROM utenti WHERE name='$name' OR email='$email'");     
114                    $contausermail mysql_num_rows($recuperauseremail);
                     
                    if(
$contausermail 0){ 
                     
                        echo 
"Nome utente o email già disponibili"
                     
                    } else { 
                         
                        
// Controllo dell'immagine del profilo                         
                        
if(is_uploaded_file($_FILES['foto']['tmp_name'])){ 
                             
                            
// Recupera le informazioni dell'immagine 
                            
list($width$height$type$attr) = getimagesize($_FILES['foto']['tmp_name']); 
                             
                            
// Controlla il peso in byte 
                            
if($_FILES['foto']['size'] > 1048576){ 
                             
                                echo 
"Il file non deve superare 1 MB!"
                                 
                             
                            } 
                            
// Controlla le dimensioni in px 
                            
} elseif (($width 500) || ($height 500)) { 
                             
                                echo 
"Le dimensioni non devono superare i 500 px!"
                                 
                            
// Controlla che il file sia un'immagine 
                            
} elseif (($type != 1) && ($type != 2) && ($type != 3)){ 
                             
                                echo 
"File non supportato!"
                                 
                            
// Controlla se sullo spazio web sia già presente il file 
                            
} elseif (file_exsists('upload/'.$_FILES['foto']['name'])){ 
                             
                                echo 
"File già esistente. Rinominarlo e riprovare!"
                             
                             
                             
                    } else { 
                         
                            
// Invia dati alla tb utenti_temp 
                         
                            
$inviautentitemp mysql_query("INSERT INTO utenti_temp (codiceconferma, nome, cognome, giorno, mese, anno, password, email, luogo, residenza, foto) VALUES ('$codiceconferma', '$nome', '$cognome', '$giorno', '$mesi', '$anno', '$password2', '$email', '$luogo', '$residenza', '$foto')"); 
                             
                            if(
$inviautentitemp){ 
                                 
                                
$to=$email
                                
$subject="Conferma la Registrazione"
                                
$header="Da: Amministratore"
                                
$message="Ecco il tuo codice di attivazione \r\n"
                                
$message.="Clicca sul link per confermare la registrazione \r\n"
                                
$message.="http://knoweveryone.altervista.org/register.php?passkey=$codiceconferma"
                                 
                                
$sentmail=mail($to,$subject,$message,$header); 
                             
                            } 
                             
                            if(
$sentmail){ 
                             
                                echo 
"Per completare la registrazione controlla la tua casella di posta elettronica e clicca sul link di attivazione."
                                 
                            }else{ 
                             
                                echo 
"Errore, link di attivazione non inviato."
                             
                            } 
                             
                        } 
                    } 
                } 
                 
            } 
         
        } else { 
             
            
$passkey $_GET['passkey']; 
             
            
$sqlrecuperauser "SELECT * FROM utenti_temp WHERE codiceconferma = '$passkey'"
            
$risultatouser mysql_query($sqlrecuperauser); 
             
            if(
$risultatouser) { 
             
                
$contauser mysql_num_rows($risultatouser); 
                 
                if(
$contauser == 1){ 
                 
                    
$rows mysql_fetch_array($risultatouser); 
                    
$nome $rows['nome']; 
                    
$cognome $rows['cognome']; 
                    
$giorno $rows['giorno']; 
                    
$mesi $rows['mese']; 
                    
$anno $rows['anno']; 
                    
$email $rows['email']; 
                    
$password $rows['password']; 
                    
$luogo $rows['luogo']; 
                    
$residenza $rows['residenza'];                     
                    
$foto $rows['foto']; 

                     
                    
$passwordcript md5($password); 
                     
                    
$sqlconfermauser mysql_query("INSERT INTO utenti (nome, cognome, giorno, mese, anno, password, email, luogo, residenza, foto) VALUES ('$nome', '$cognome', '$giorno', '$mesi', '$anno', '$password2', '$email', '$luogo', '$residenza', '$foto')"); 
                     
                    if (
$sqlconfermauser) { 
                     
                        echo 
"Il tuo account è stato attivato con successo"
                        
$sqleliminadati mysql_query("DELETE FROM utenti_temp WHERE codiceconferma = '$passkey'"); 
                     
                    } else { 
                     
                        echo 
"Errore!"
                     
                    } 
                 
                } 
             
            } 
             
        } 

    
?> 
     
     
    </div> 
     
     
</body> 
</html>

Conto molto sul vostro aiuto, soprattutto su quello di RoTeam, grazie in anticipo,
Giuseppe.