RISOLTO

Codice PHP:
session_start();
    
        if (isset(
$_POST['email'])&&isset($_POST['codice'])) {
            
            
$email $_POST['email'];
            
$code $_POST['codice'];
            
            
$_SESSION['email'] = $email;
            
$_SESSION['codice'] = $code;
                            
            if (
$email&&$code) {
            
                
$con mysql_connect('localhost','root',''
                    or die (
'Errore di connessione');                
                
mysql_select_db('noteit'
                    or die (
'Errore');
            
                
$query mysql_query("SELECT * FROM utenti WHERE EMAIL='$email'");                
                
$numrow mysql_num_rows($query);
                
                if (
$numrow!=0) {    
                                        
                    while (
$row mysql_fetch_assoc($query)) {
                        
$dbemail $row['EMAIL'];
                        
$dbcode $row['CODICE'];
                        
$nom $row['NOME'];
                        
$cog $row['COGNOME'];
                    }
                        
$_SESSION['nome'] = $nom;
                        
$_SESSION['cognome'] = $cog;                    
                                                
                        if (
$email==$dbemail&&$code==$dbcode) {
                                                                                                                
                        } else {
                            die (
'Codice errato!');
                        }
            
                    } else {
                        die (
'Questo utente non esiste!');
                    }
                    
                } else {
                    die (
'Errore, controlla i dati!');
                }
            
            }
    
        
$nom $_SESSION['nome'];
        
$cog $_SESSION['cognome'];
        
$email $_SESSION['email'];
        
$code $_SESSION['codice'];
        
        echo 
$nom.' '.$cog.'
'
.$email.'
'
.$code