Salve a tutti,
Ho questa pagina php:
Codice PHP:
<?php
    
require_once("inclusione.php");
    
$_SESSION["registro"]["conferma"]="non confermato";
?>
<html>
    <head>
        <title>School Project</title>
        <link rel="stylesheet" type="text/css" href="style.css" />
        <script>
            function giorni() {
                a = document.iscrizione.anno
                aa = a.options[a.selectedIndex].value
                m = document.iscrizione.mese
                mm = m.options[m.selectedIndex].value
                g = document.iscrizione.giorno
                gg = 1

                for (i = g.length; i > 0; i--) {
                    g.options[i-1] = null
                }

                d = new Date(aa, mm, gg)
                while (d.getMonth()==mm) {
                    g.options[gg-1] = new Option((gg))
                    d = new Date(aa, mm, ++gg)
                }
                g.selectedIndex = 0
            }
        </script>
    </head>
    <body>
        <div id="scroll_menu">
            <ul id="menu" class="blue">
            [*][url="index.php"]<span>Home</span>[/url]
            [*][url="registrazione.php"]<span>Registrati</span>[/url]
            [*][url="login.php"]<span>Accedi</span>[/url]
            [/list]
        </div>
<?php 
    $controllo
=0;
    if(isset(
$_POST["submit"])){
            
//Poniamo le variabili in session per poterle mantenere
            
$_SESSION["username"]=$_POST["username"];
            
$_SESSION["nome"]=$_POST["nome"];
            
$_SESSION["cognome"]=$_POST["cognome"];
            
$_SESSION["email"]=$_POST["email"];
            
$_SESSION["indirizzo"]=$_POST["indirizzo"];
            
$_SESSION["n_civico"]=$_POST["n_civico"];
            
$_SESSION["citta"]=$_POST["citta"];
            
$_SESSION["cap"]=$_POST["cap"];
            
$_SESSION["telefono"]=$_POST["telefono"];
            
$_SESSION["cellulare"]=$_POST["cellulare"];
            
$_SESSION["password"]=$_POST["password"];
            
$data_iscr=date('d-m-Y');
            
//controllo sul nome
            
if(empty ($_POST["nome"])){
                
$_SESSION["registro"]["nome"]="[*]Inserisci il tuo Nome";
            }else if(!
preg_match('/^[A-Za-zèùàòé][a-zA-Z\'èùàòé ]*$/',$_POST["nome"])){
                
$_SESSION["registro"]["nome"]="[*]Hai inserito caratteri non validi nel tuo Nome...";
            }else if(
strlen($_POST["nome"]) <= 3){
                
$_SESSION["registro"]["nome"]="[*]Il Nome inserito e' troppo corto...";
            }else{
                
$controllo++;
                
$_SESSION["registro"]["nome"]="";
            }
            
//controllo sul cognome
            
if(empty ($_POST["cognome"])){
                
$_SESSION["registro"]["cognome"]="[*]Inserisci il tuo Cognome!";
            }else if(!
preg_match('/^[A-Za-zèùàòé][a-zA-Z\'èùàòé ]*$/',$_POST["cognome"])){
                
$_SESSION["registro"]["cognome"]="[*]Hai inserito caratteri non validi nel tuo Cognome...";
            }else if(
strlen($_POST["cognome"]) <= 3){
                
$_SESSION["registro"]["cognome"]="[*]Il Cognome inserito e' troppo corto...";
            }else{
                
$controllo++;
                
$_SESSION["registro"]["cognome"]="";
            }
            
//controllo sull' username
            
if(empty ($_POST["username"])){
                
$_SESSION["registro"]["username"]="[*]Inserisci il tuo Username!";
            }else if(!
preg_match("/[A-Z0-9]/i",$_POST["username"])){
                
$_SESSION["registro"]["username"]="[*]Hai inserito caratteri non validi nel tuo Username...";
            }else if(
strlen($_POST["username"]) < 3){
                
$_SESSION["registro"]["username"]="[*]L' Username inserito e' troppo corto...";
            }else{
                
$controllo++;
                
$_SESSION["registro"]["username"]="";
            }
            
//controllo sulla Password
            
if($_POST["password"] != $_POST["conf_pass"]){
                
$_SESSION["registro"]["password"]="[*]Le password inserite non corrispondono";
            }else if(empty (
$_POST["password"]) || empty ($_POST["conf_pass"])){
                
$_SESSION["registro"]["password"]="[*]Hai lasciato dei campi riguardanti le Password vuoti...";
            }else if(
strlen($_POST["password"]) < 3){
                
$_SESSION["registro"]["password"]="[*]La Password inserita e' troppo corta...";
            }else{
                
$controllo++;
                
$_SESSION["registro"]["password"]="";
            }
            
//controllo sulla E-Mail
            
if(empty($_POST["email"])){
                
$_SESSION["registro"]["email"]="[*]Inserisci la tua E-mail !";
            }else if(!
preg_match('/^[A-Z0-9._%-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i',$_POST["email"])){
                
$_SESSION["registro"]["email"]="[*]E-Mail non valida !";
            }else{
                
$controllo++;
                
$_SESSION["registro"]["email"]="";
            }
            
//creazione codice di attivazione
                
$N_Caratteri 10;
                
$code_act "";
                For(
$I=0;$I<$N_Caratteri;$I++){
                    do{
                        
$N Ceil(rand(48,122));
                    }while(!(((
$N >= 48) && ($N <= 57)) || (($N >= 65) && ($N <= 90)) || (($N >= 97) && ($N <= 122))));
                    
$code_act $code_act.Chr ($N);
                }
            if((
$controllo) == 5){
                
$dmn "INSERT INTO utenti (`nome_utente`, cognome_utente , username , password , email, code_act, data_iscr) VALUES ('".$_SESSION["nome"]."','".$_SESSION["cognome"]."','".$_SESSION["username"]."','".$_SESSION["password"]."','".$_SESSION["email"]."','".$code_act."','".$data_iscr."')";
                
$risultato $connessione->update($dmn);
                
$anag "INSERT INTO utenti ( n_civico, citta , cap , telefono , cellulare , indirizzo) VALUES ('".$_SESSION["n_civico"]."','".$_SESSION["citta"]."','".$_SESSION["cap"]."','".$_SESSION["telefono"]."','".$_SESSION["cellulare"]."','".$_SESSION["indirizzo"]."')";
                
$ris_anag $connessione->update($anag);
                echo 
"registrazione effettuata con successo!";
                
// Il messaggio
                
$message "Salve".$_SESSION["nome"].", il suo account School Project e' in attessa di Abilitazione... Sara' pronto appena possibile!";
                
// Messaggio lungo massimo 300 caratteri
                
$message wordwrap($message500);
                
// Invia
                
mail($_SESSION["email"] , "Attivazione Account SP" $message);
            }else{
                
$_SESSION["registro"]["errori"] = "presenti";
            }
        if((
$_SESSION["registro"]["errori"])== "presenti"){
            echo 
'<div id="errors">';
            echo 
$_SESSION["registro"]["nome"];
            echo 
$_SESSION["registro"]["cognome"];
            echo 
$_SESSION["registro"]["username"];
            echo 
$_SESSION["registro"]["password"];
            echo 
$_SESSION["registro"]["email"];
            echo 
'</div>';
        }
    }
    
$_SESSION["registro"]["errori"]="";
?>
        <form method="post" id="form" name="iscrizione">
            <h2>I tuoi dati fondamentali:</h2>
            <div class="regi">
                <label for="nome">Nome:</label>
                <input type="text" name="nome" maxlength="15" value="<?php if(isset($_SESSION["nome"])) echo $_SESSION["nome"?>" />
                <label for="cognome">Cognome:</label>
                <input type="text" name="cognome" maxlength="20" value="<?php if(isset($_SESSION["cognome"])) echo $_SESSION["cognome"?>" />
                <label for="username">Username:</label>
                <input type="text" name="username" maxlength="20" value="<?php if(isset($_SESSION["username"])) echo $_SESSION["username"?>" />
                <label for="password">Password:</label>
                <input type="password" maxlength="20" name="password" />
                <label for="conf_pass">Conferma Password:</label>
                <input type="password" name="conf_pass" />
                <label for="email">E-Mail:</label>
                <input type="text" name="email" maxlength="30" value="<?php if(isset($_SESSION["email"])) echo $_SESSION["email"?>" />
            </div>
            <h2>I tuoi dati personali:</h2>
            <div class="regi">
                <label for="indirizzo">Indirizzo:</label>
                <input type="text" name="indirizzo" maxlength="30" value="<?php if(isset($_SESSION["indirizzo"])) echo $_SESSION["indirizzo"?>" />
                <label for="n_civico">Numero Civico:</label>
                <input type="text" name="n_civico" maxlength="8" value="<?php if(isset($_SESSION["n_civico"])) echo $_SESSION["n_civico"?>" />
                <label for="citta">Citt&agrave;:</label>
                <input type="text" name="citta" maxlength="20" value="<?php if(isset($_SESSION["citta"])) echo $_SESSION["citta"?>" />
                <label for="cap">CAP/ZIP:</label>
                <input type="text" name="cap" maxlength="5" value="<?php if(isset($_SESSION["cap"])) echo $_SESSION["cap"?>" />
                <label for="telefono">Telefono:</label>
                <input type="text" name="telefono" maxlength="10" value="<?php if(isset($_SESSION["telefono"])) echo $_SESSION["telefono"?>" />
                <label for="cellulare">Cellulare:</label>
                <input type="text" name="cellulare" maxlength="10" value="<?php if(isset($_SESSION["cellulare"])) echo $_SESSION["cellulare"?>" />
                <label for="submit"></label>
                <input type="submit" id="submit" name="submit" value="Registrati" />
            </div>
        </form>
    </body>
</html>
Una semplice pagina di iscrizione che però non inserisce i dati nel db.
Non so se sia un problema di apache o di mysql o di php che ho installati sulla mia macchina, perchè dopo che invio il form senza che mi abbia dato nessun errore vado a controllare se nel db i dati sono stati inseriti però la tabella "utenti" risulta vuota...
Non sono espertissimo nell'ambito db però un problema del genere non mi è mai capitato

Grazie a tutti in anticipo