Salta al contenuto
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • 0 Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.
Collassa
Connect.gt
Il network Search On
Connect.gt WMF AI Festival Accademia Advanced SEO Tool AgentCy Social Media Strategies Search Tech
Registrati Accedi
Connect.gt
Stream Interest Categorie Hashtag
G

giovi73

@giovi73
Non seguire Segui
Informazioni
Post
3
Discussioni
1
Condivisioni
0
Gruppi
0
Da chi è seguito
0
Chi segue
0

Post

Recenti Migliore Controverso

  • Errore Login pannello amministratore Joomla
    G giovi73
    CMS & Piattaforme Self-Hosted

    Ciao! Grazie davvero! Il tuo aiuto mi ha salvata!
    Ciao
    G.


  • Form con file allegati e e-mail multipla
    G giovi73
    Coding

    massy

    Ciao e benvenuta.

    Sul manuale online di php trovi la risposta alle tue domande.
    http://it.php.net/manual/it/function.mail.php

    Ps ho modificato il tuo post racchiundendo il codice tra i tag [ quote ]
    Pps stai attenta alla sicurezza del tuo script. Se cerchi nel forum ne abbiamo parlato qualche giorno fa. 🙂

    Ciao, grazie 1000 per la tua risposta.

    Guardando il link che mi hai indicato riesco a fare arrivare la mail a due destinatari di posta. Ma purtroppo non riesco a inviare correttamente i file allegati. Sto impazzendo... anche perchè io non so niente di php...
    Volevo anche chiederti che cosa intendi per sicurezza degli script: io ho cercato ma, non essendo un programmatore, non riesco a capire bene.

    Mi puoi aiutare?

    Grazie 1000
    Giovi


  • Form con file allegati e e-mail multipla
    G giovi73
    Coding

    Ciao a tutti,
    ho un problema che non riesco a risolvere con un form: tutti i campi sono obbligatori e sono riuscita a sistemare i controlli (per cui se c'è un campo non compilato il form non può essere inviato).

    Facendo delle prove, all'indirizo specificato arriva correttamente una mail con il riepilogo dei dati inseriti nei campi testo e nel radio button.

    Però non so come fare per:

    1. fare in modo che via mail vengano spediti anche i due file come allegati
    2. fare in modo che la mail (con i dati inseriti nei campi del form + i due allegati) arrivi a due indirizzi e-mail distinti

    Codice form:

    <form action="inviaprova.php" method="post" name="form" id="form" enctype="multipart/form-data">
              <input name="subject" type="hidden" value="Form dati" />
              <input name="recipient" type="hidden" value="[email protected]" />
              <input name="return_link_title" type="hidden" value="miosito.it" />
              <input name="return_link_url" type="hidden" value="http://www.miosito.it" />
              <input type="hidden" name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT" />
              <input type="hidden" name="redirect" value="http://www.miosito.it/conferma.php" />
              <tr>
                <td><strong>Referente in azienda * :</strong></td>
                <td><input name="Referente" value="" /></td>
              </tr>
              <tr>
                <td> </td>
                <td> </td>
              </tr>
              <tr>
                <td><strong>Ragione Sociale * : </strong></td>
                <td><input name="Azienda" value="" /></td>
              </tr>
              <tr>
                <td> </td>
                <td></td>
              </tr>
              <tr>
                <td><strong>Indirizzo * :</strong></td>
                <td><input name="Indirizzo" value="" size="30" />
                </td>
              </tr>
              <tr>
                <td> </td>
                <td></td>
              </tr>
              <tr>
                <td><strong>C.A.P. * :</strong></td>
                <td><input name="CAP" id="CAP" value="" size="5" maxlength="5" />
                </td>
              </tr>
              <tr>
                <td> </td>
                <td></td>
              </tr>
              <tr>
                <td><strong>Città * :</strong></td>
                <td><input name="Citta" id="Citta" value="" />
                </td>
              </tr>
              <tr>
                <td colspan="2"><br /></td>
              </tr>
              <tr>
                <td colspan="2"><div align="center"><strong><br />
                  Consenso</strong><br />
                  <br />
                  Informativa privacy <br />
                  <br />
                  Accetta
                  <input name="Consenso" value="si" type="radio" />
                  si
                  <input name="Consenso" value="no" type="radio" />
                  no <br />
                  <br />
                  <br />
                </div></td>
              </tr>
              <tr>
                <td colspan="2">E' neccesario allegare due file:<br />
                  1. nominativi<br />
                  2. file zip con foto </td>
              </tr>
              <tr>
                <td colspan="2"> </td>
              </tr>
              <tr>
                <td><strong>Allegare elenco nominativi *:</strong> <br /></td>
                <td><b><font face="Arial" size="2"> </font></b>
                    <input name="Nominativi" type="file" />
                </td>
              </tr>
              <tr>
                <td> </td>
                <td> </td>
              </tr>
              <tr>
                <td><strong>Allegare file zip * :</strong> </td>
                <td><input name="Foto" type="file" /></td>
              </tr>
              <tr>
                <td> </td>
                <td> </td>
              </tr>
              <tr>
                <td colspan="2"> </td>
              </tr>
              <tr>
                <td colspan="2"><div align="center">
                  <input name="Invia" type="button" id="Invia" value="Invia" onclick="validaiscritti()" />
                </div></td>
              </tr>
            </form>
    

    Javascript utilizzato per il controlli dei campi:

    <script language="JavaScript1.2">
    <!--
    function validaiscritti(){
    
        var c1=this.document.forms[0].elements['Referente'].value;
        var c2=this.document.forms[0].elements['Azienda'].value;
        var c3=this.document.forms[0].elements['Indirizzo'].value;
        var c4=this.document.forms[0].elements['CAP'].value;
        var c5=this.document.forms[0].elements['Citta'].value;
        var c7=stateChecker()
        var f1=this.document.forms[0].elements['Nominativi'].value;
        var f2=this.document.forms[0].elements['Foto'].value;      
        if (c7!="si") {
            alert("E' necessario esprimere il proprio consenso per iscriversi")
        }
        else
        {
            if (c1!="" && c2!="" && c3!="" && c4!="" && c5!="" && f1 != "" && f2 != "")
            {
                document.forms[0].submit();
            }
            else
            {
                if (c1==""){
                    alert("Il campo Referente è obbligatorio");
                }
                if ( c2==""){
                    alert("Il campo Azienda è obbligatorio");
                }
                if (c3==""){
                    alert("Il campo Indirizzo è obbligatorio");
                }
                if  (c4== "") {
                    alert("Il campo CAP è obbligatorio"); 
                }  
                if  (c5== "") {
                    alert("Il campo Città è obbligatorio"); 
                }  
                if  (f1== "") {
                    alert("Il file dei nominativi è necessario"); 
                }  
                if  (f2 == "") {
                    alert("Il file delle foto è necessario"); 
                }  
                return false;           
            }
        }
    }
    
    function stateChecker()
    {   var checkedButton = ""  
     for (var i=0 ; i< document.forms[0].Consenso.length; i++)
    {     if (document.forms[0].Consenso[i].checked=="1")
    { checkedButton=document.forms[0].Consenso[i].value ; }
      }
    return checkedButton
    }
    -->
    </script>
    

    Codice nel file utilizzato per l'invio della mail:

    <?php
    
    $to = "[email protected]";
    $mittente = "[email protected]";
    $subject = $_POST['subject']; 
    $Referente = $_POST['Referente'];
    $Azienda = $_POST['Azienda'];
    $Citta = $_POST['Citta'];
    $Indirizzo = $_POST['Indirizzo'];
    $CAP = $_POST['CAP'];
    $Consenso = $_POST['Consenso'];
    
    $headers = "From: " . $mittente;
    $msg = "";
    
    $body .= "Testo mail....\n";
    $body .= "\n"; 
    $body .= "---------------------------------------------------------------------------\n"; 
    $body .= "Referente: ".$Referente."\n";
    $body .= "\n"; 
    $body .= "Azienda: ".$Azienda."\n";
    $body .= "\n"; 
    $body .= "Indirizzo: ".$Indirizzo."\n";
    $body .= "\n"; 
    $body .= "C.A.P.: ".$CAP."\n";
    $body .= "\n"; 
    $body .= "Città: ".$Citta."\n";
    $body .= "\n"; 
    $body .= "Consenso al trattamento dei dati: ".$Consenso."\n"; 
    $body .= "---------------------------------------------------------------------------\n"; 
    $red = $_POST['redirect'];
    if (mail($to, $subject, $body, $headers)) {
        header("location: ".$red);   
     } else {
        echo("<p>Message delivery failed...</p>");
     }
    ?>
    

    Per favore, qualcuno sa aiutarmi?

    Grazie 1000
    Giovel

  • Accedi

  • Non hai un account? Registrati

  • Accedi o registrati per effettuare la ricerca.
  • Primo post
    Ultimo post
Home Accedi Registrati
Menu
  • CATEGORIES
  • La Community Connect.gt
  • Presentati alla Community
  • News Ufficiali da Connect.gt
  • Internet News
  • A Scuola Di
  • Digital Marketing
  • Intelligenza Artificiale
  • SEO & GEO
  • Web Marketing e Content
  • Google Analytics e Web Analytics
  • Google Ads & Advertising
  • YouTube
  • TikTok, Instagram e altri Social
  • Google Adsense, Affiliazioni e Guadagno
  • E-Commerce
  • Coding e Sistemistica
  • Help Center: consigli per il tuo progetto
  • Hosting e Cloud
  • Coding
  • CMS & Piattaforme Self-Hosted
  • Annunci e Collaborazioni
  • Annunci Vendita e Acquisto: Pubblicità, Domini, Link e altro
  • Collaborazioni WEB e Lavoro: offro e cerco
  • Impresa, Fisco e Leggi
  • Consulenza Legale e Professioni Web
  • Consulenza Fiscale, Imprese, Startup e P.Iva
  • Gli Off Topic
  • PC, Smartphone e altri Hardware
  • Tutti i Software
  • GT Fetish Cafè
  • Discussioni
  • Non letti 0
  • Recenti
  • Hashtag
  • Popolare
  • Utenti
  • Privacy
  • Termini e condizioni
  • © 2026 Search On Media Group S.r.l.