• User

    Form flash + Php con check box privacy

    Salve a tutti, premetto che sono un grafico al quale sfortunamente hanno chiesto di programmare un form in flash+php!!
    Avrei bisogno di un aiuto per aggiungere il check box per la Privacy ad un form in flash ed aggiungere al codice php il codice relativo. Il check box deve controllare che se l'utente non accetta la mail non può partire. Se qualcuno può aiutarmi, posso contraccambiare con un link sul mio blog sulla grafica che va benino (media di circa 100 pagine viste al giorno) oppure con la grafica per un banner.
    non posso allegare il files perchè superano anche di poco il peso consentito quindi posto di seguito. GRAZIE

    Actionscript del form:

    
    pulsante.onRelease = function ()
    {
        trace ('prosegue')
        var _loc2 = new LoadVars();
        _loc2.Nome = casellaNome.text;
        _loc2.Cognome = casellaCognome.text;
        _loc2.Societa = casellaSocieta.text;
        _loc2.Email = casellaEmail.text;
        _loc2.Telefono = casellaTelefono.text;
        _loc2.Fax = casellaFax.text;
        _loc2.Note = casellaNote.text;
        _loc2.destinatario = "[email protected]";
        _loc2.onLoad = function (success)
    {
        }
       if (casellaNome.length<2) {
            testoErrore = "Campo Errato  ";
            scriviErrore(testoErrore);
            name_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            name_txt.textColor = 0xFFFFFF;
        }
        
        if (casellaEmail.text.indexOf("@")<2) {
              testoErrore = "Email Errata         ";
            scriviErrore(testoErrore);
              email_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            email_txt.textColor = 0xFFFFFF;
        
        }
        if (casellaTelefono.length<4) {
            testoErrore = " Campo Errato";
            scriviErrore(testoErrore);
              telefono_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            telefono_txt.textColor = 0xFFFFFF;
        }
        if (casellaCognome.length<2) {
            testoErrore = " Campo Errato";
            scriviErrore(testoErrore);
            cognome_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            cognome_txt.textColor = 0xFFFFFF;;
        }
        if (casellaSocieta.length<4) {
            testoErrore = " Campo Errato";
            scriviErrore(testoErrore);
            societa_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            societa_txt.textColor = 0xFFFFFF;
        }
        if (casellaNote.length<2) {
            note_txt.textColor = 0xFF0000;
            corretto = false
        }else{
            note_txt.textColor = 0xFFFFFF;
            
        }
        if (corretto)
         _loc2.sendAndLoad("email.php", _loc2, "POST");      
      
       {
       
            if (success)
            {
                casellaNome.text = "";
                casellaCognome.text = "";
                casellaSocieta.text = "";
                casellaEmail.text = "";
                casellaTelefono.text = "";
                casellaFax.text = "";
                casellaNote.text = "";
                mcMsg.mcTxt.txtMsg.text = this.controllo;
                mcMsg.play();
                
            } 
        }
    }
    
    
    

    Actionscript del pulsante INVIO

    
    on (press) {
    _root.errore._visible=false;
    
        _root.errore.text="";
        var corretto:Boolean = true;
        
        if (casellaNome.length<2) {
            testoErrore = "";
            scriviErrore(testoErrore);
            name_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            name_txt.textColor = 0xFFFFFF;
        }
        
        if (casellaEmail.text.indexOf("@")<2) {
              testoErrore = "";
            scriviErrore(testoErrore);
              email_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            email_txt.textColor = 0xFFFFFF;
        
        }
        if (casellaTelefono.length<4) {
            testoErrore = "";
            scriviErrore(testoErrore);
              telefono_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            telefono_txt.textColor = 0xFFFFFF;
        }
        if (casellaCognome.length<2) {
            testoErrore = "";
            scriviErrore(testoErrore);
            cognome_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            cognome_txt.textColor = 0xFFFFFF;;
        }
        if (casellaSocieta.length<4) {
            testoErrore = "";
            scriviErrore(testoErrore);
            societa_txt.textColor = 0xFF0000;
        corretto = false
        }else{
            societa_txt.textColor = 0xFFFFFF;
        }
        if (casellaNote.length<2) {
            note_txt.textColor = 0xFF0000;
            corretto = false
        }else{
            note_txt.textColor = 0xFFFFFF;
            
        }
        if (corretto) {
    
         _root.invio._visible= true ;
        trace("invio corretto");
        } else {
            _root.errore._visible = true;
    
        }
    function scriviErrore(stringaErrore:String) {
        _root.errore.text += stringaErrore+" ";
    }
    }
    
    

    codice PHP

    
    <?php
    $casellaNome = stripslashes($_POST['Nome']);
    $casellaCognome = stripslashes($_POST['Cognome']);
    $casellaSocieta = stripslashes($_POST['Societa']);
    $casellaEmail = stripslashes($_POST['Email']);
    $casellaTelefono = stripslashes($_POST['Telefono']);
    $casellaFax = stripslashes($_POST['Fax']);
    $casellaNote = stripslashes($_POST['Note']);
    $destinatario = stripslashes($_POST['destinatario']);
    
    $sms = '
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Contatti</title>
    <style type="text/css">
    td{
    font-family:Verdana, Arial, Helvetica, sans-serif;
    font-size:10px;
    color:#666666;
    }
    </style>
    </head>
    <body style="margin:0px;">
    <table cellpadding="0" cellspacing="0" style="height:100%;width:500px;">
    <tr>
    <td style="height:100%;padding:20px;vertical-align:top;">
    <table>
    <tr><td colspan="2">
    <br /><br /></td></tr>
    <tr><td width="80"><b>Nome:</b></td>
    <td width="259">'.$casellaNome.'</td></tr>
    <tr><td width="80"><b>Cognome:</b></td>
    <td width="259">'.$casellaCognome.'</td></tr>
    <tr><td><b>Società</b></td>
    <td>'.$casellaSocieta.'</td></tr>
    <tr><td><b>E-mail</b></td>
    <td>'.$casellaEmail.'</td></tr>
    <tr><td><b>Telefono</b></td>
    <td>'.$casellaTelefono.'</td></tr>
    <tr><td><b>Fax </b></td>
    <td>'.$casellaFax.'</td></tr>
    <tr><td><b>Note</b></td>
    <td>'.$casellaNote.'</td></tr>
    <tr><td><b>Privacy</b></td>
    <td>'.$casellaprivacy.'</td></tr>
    <tr><td colspan="2">&nbsp;</td></tr>
    </table></td></tr></table></body></html>';
    
    $headers = "From: $casellaNome $casellaCognome <$casellaEmail>\n";
    $headers .= "Content-Type: text/html; charset=iso-8859-1\n";
    $oggetto = " Messaggio dal sito web \n";
    if(mail($destinatario, $oggetto, $sms, $headers)){
    echo "Ok";
    echo '&controllo=invio avvenuto con successo.';
    }
    else{
    echo '&controllo=errore: e-mail non inviata.';
    }
    ?> 
    
    

    GRAZIE