• Home
  • Forum
  • Fare Web
  • Javascript

Script java per checkbox per informativa privacy

  • Creatore Discussione Creatore Discussione muppa
  • Data di inizio Data di inizio 29 Ott 2010
M

muppa

Nuovo Utente
26 Ott 2010
9
0
0
  • 29 Ott 2010
  • #1
ciao a tutti ho recuperato uno script in java che dovrebbe permettermi di inserire in un modulo in php l'informativa sulla privacy da accettare prima di proseguire ed è questo:

Codice:
function checkForm() { 

     form=document.nome_del_form  //ci metti il nome del tuo form 

     if (!(form.trattamento_dati.checked)) { 

           alert("Devi accettare il trattamento dei dati"); 
           return; 
     } 
     else { 
     
        form.target = "_parent"; 
        form.action = "file.php"; //il file che esegue lo script associato alla form 
        form.method = "POST";  //o GET 
        form.submit();     
     } 

}

Dove il file dove c'è il codice php è prova.php ed il nome del modulo (ma non ne sono sicuro) è modulo.
quindi ho fatto:
Codice:
function checkForm() { 

     form=document.modulo  //ci metti il nome del tuo form 

     if (!(form.trattamento_dati.checked)) { 

           alert("Devi accettare il trattamento dei dati"); 
           return; 
     } 
     else { 
     
        form.target = "_parent"; 
        form.action = "prova.php"; //il file che esegue lo script associato alla form 
        form.method = "POST";  //o GET 
        form.submit();     
     } 

}
il pulsante submit l'ho sostituito con questo codice:
<input type="button" name="Invia" value="Invia" onclick="checkForm()">

invece la checkbox ha questo codice:
<input type="checkbox" name="trattamento_dati">

Sono andato ad operare sulla pagina dove c'è il codice del form (prova.php) ma non riesco a farlo funzionare.
 
M

muppa

Nuovo Utente
26 Ott 2010
9
0
0
  • 29 Ott 2010
  • #2
Il codice della pagina prova.php dove vorrei inserire lo script java è questo:
PHP:
<html>
<head>
<title>Titolo</title>
<META NAME="DC.Title" CONTENT="Titolo">
<META NAME="keywords" CONTENT="">
<meta name="description" content="titolo">
<meta http-equiv="Content-Language" content="IT">
<meta name="author" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">


<style type="text/css">
<!--
.Stile1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
}
.Stile2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #0099FF;
}
.Stile5 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	font-size: 14px;
	color: #000000;
}
.Stile10 {color: #000000; font-family: "Times New Roman", Times, serif; }
.Stile11 {color: #000000}
.Stile14 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; }
.Stile16 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; }
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="320" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td><?php
$passo=$_GET["passo"];
if($passo!='1'){
?>
        <form action="prova.php?passo=1" method="post" name="modulo" id="modulo">
          <table width="320" border="0" align="center" cellpadding="0" cellspacing="0">
            
            <tr>
              <td width="88" align="center" valign="top" class="testo">&nbsp;</td>
              <td width="232" align="center" valign="top" class="testo">DATI </td>
            </tr>
            <tr>
              <td width="88" align="right"><span class="Stile14">Nome e Cognome</span></td>
              <td width="232" align="right"><input name="nome" type="text" id="nome"></td>
            </tr>
            <tr>
              <td width="88" height="5" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
              <td width="232" height="5" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right"><span class="Stile14">Via</span></td>
              <td width="232" align="right"><input name="via" type="text" id="via"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right" class="Stile14">Numero</td>
              <td height="10" align="right"><input name="numero" type="text" id="numero"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right" class="Stile14">CAP</td>
              <td height="10" align="right"><input name="cap" type="text" id="cap"></td>
            </tr>
            <tr>
            <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td width="88" height="10" align="right"><span class="Stile14">Città</span></td>
              <td width="232" height="10" align="right"><input name="citta" type="text" id="citta"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right" class="Stile14">Provincia</td>
              <td height="10" align="right"><input name="provincia" type="text" id="provincia"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right"><span class="Stile14">Telefono</span></td>
              <td width="232" align="right"><input name="telfax" type="text" id="telfax"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right"><span class="Stile14">Fax</span></td>
              <td height="10" align="right"><input name="telfax2" type="text" id="telfax2"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right"><span class="Stile14">Cellulare</span></td>
              <td height="10" align="right"><input name="telfax3" type="text" id="telfax3"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right"><span class="Stile14">E-mail</span></td>
              <td width="232" align="right"><input name="email" type="text" id="email"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            
            <tr>
              <td height="10" align="right" class="Stile14">Pagamento: </td>
              <td height="10" align="right"><table width="232" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="right"><span class="Stile14">Bonifico</span>
                  <input name="ctel2" type="radio" value="bonifico"></td>
                  <td align="right"><span class="Stile14">Vaglia</span>
                  <input name="ctel2" type="radio" value="vaglia"></td>
                </tr>
              </table></td>
            </tr>
            
            
            <tr>
              <td height="10" colspan="2" align="right"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right" valign="top" class="Stile14">Note</td>
              <td width="232" align="right"><textarea name="richieste" rows="8" wrap="VIRTUAL" id="richieste"></textarea></td>
            </tr>
            <tr>
              <td width="88" height="10" align="right"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
              <td width="232" height="10" align="right"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="top" class="Stile14"><iframe frameborder="0" id="content" name="content" src="informativa.html" width="300
    " height="300" ></iframe></td>
            </tr>
            <tr>
              <td align="right" class="Stile14">Acconsento al trattamento dei dati</td>
              <td align="right"><table width="232" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="right"><span class="Stile14">Si </span>
                      <input name="ctel3" type="radio" value="si"></td>
                  <td align="right">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="right">&nbsp;</td>
            </tr>
            <tr>
              <td width="88" align="right">&nbsp;</td>
              <td width="232" align="right"><input name="Submit" type="submit" value="Invia richiesta"></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td height="10" align="right"><input name="Submit2" type="reset" value="Annulla"></td>
            </tr>
            <tr>
              <td width="88" align="right">&nbsp;</td>
              <td width="232" height="10" align="right"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
            </tr>
          </table>
      </form>
      <?php
}else if($passo=='1'){
	$destinatario  = "<" . $_REQUEST["email"] . ">";
	$oggetto = "oggetto";
	$corpodelmessaggio = '
	<html>
	<head>
	 <title>Titolo</title>
	</head>
	<body>
	<p>Grazie per aver scelto il nostro sito </p>
	<p>Le sue richieste saranno esaudite al pi&ugrave; presto</p>
	<p>Nome</p>
	</body>
	</html>
	';
	$headers = "From: tua@mail.it\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
	//unique boundary
	$boundary = uniqid("inviodati");
	//tell e-mail client this e-mail contains//alternate versions
	$headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";
	//HTML version of message
	$body .= "--$boundary\r\n" .
	   "Content-Type: text/html; charset=ISO-8859-1\r\n" .
	   "Content-Transfer-Encoding: base64\r\n\r\n";
	$body .= chunk_split(base64_encode($corpodelmessaggio));
	//send message
	mail($destinatario, $oggetto, $body, $headers);
//seconda mail
	$oggetto = "Richiesta informazioni dal sito";
	$corpodelmessaggio = '
	<html>
	<head>
	 <title>Titolo</title>
	</head>
	<body>
	<p>Nome e cognome: ' . $_REQUEST["nome"] . '</p>
	<p>via: ' . $_REQUEST["via"] . '</p>
	<p>numero: ' . $_REQUEST["numero"] . '</p>
	<p>cap: ' . $_REQUEST["cap"] . '</p>
	<p>città: ' . $_REQUEST["citta"] . '</p>
	<p>provincia: ' . $_REQUEST["provincia"] . '</p>
	<p>Telefono: ' . $_REQUEST["telfax"] . '</p>
	<p>Fax: ' . $_REQUEST["telfax2"] . '</p>
	<p>Cellulare: ' . $_REQUEST["telfax3"] . '</p>
	<p>E-mail: ' . $_REQUEST["email"] . '</p>
	<p>tipo pagamento: ' . $_REQUEST["ctel2"] . '</p>
	<p>Acconsento al trattamento dei dati: ' . $_REQUEST["ctel3"] . '</p>
	<p>note: ' . $_REQUEST["richieste"] . '</p>
	
	</body>
	</html>
	';
	$headers = "From: tua@mail.it\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
	//unique boundary
	$boundary = uniqid("inviodati");
	//tell e-mail client this e-mail contains//alternate versions
	$headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";
	//HTML version of message
	$body .= "--$boundary\r\n" .
	   "Content-Type: text/html; charset=ISO-8859-1\r\n" .
	   "Content-Transfer-Encoding: base64\r\n\r\n";
	$body .= chunk_split(base64_encode($corpodelmessaggio));
	//send message
	mail("tua@mail.it", $oggetto, $body, $headers);
?>
        <table width="280" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><div align="center" class="titolo Stile2"><strong>Riepilogo 
            informazioni inviate</strong><br>
            </div></td>
          </tr>
          <tr>
            <td height="20">&nbsp;</td>
          </tr>
          <tr>
            <td><span class="Stile1 Stile11">Nome e cognome: </span> <span class="testo"><?php echo($_REQUEST["nome"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Via: </span> <span class="testo"><?php echo($_REQUEST["via"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Citt&agrave;: </span> <span class="testo"><?php echo($_REQUEST["citta"]) ?></span></td>
          </tr>

          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Telefono: </span> <span class="testo"><?php echo($_REQUEST["telfax"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td height="10"><span class="Stile16">Fax: </span> <span class="testo"><?php echo($_REQUEST["telfax2"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td height="10"><span class="Stile16">Cellulare: </span> <span class="testo"><?php echo($_REQUEST["telfax3"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">E-mail: </span> <span class="testo"><?php echo($_REQUEST["email"]) ?></span></td>
          </tr>
          
          
          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Note: </span> <span class="testo"><?php echo($_REQUEST["richieste"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="http://forum.mrwebmaster.it/immagini/e_commerce/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16"><strong>Acconsento al trattamento dei dati</strong>:<span class="testo"><?php echo($_REQUEST["ctel3"]) ?></span></span></td>
          </tr>
        </table>
    <?php
}
?>    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

</body>
</html>

Grazie per le eventuali risposte
 
M

muppa

Nuovo Utente
26 Ott 2010
9
0
0
  • 29 Ott 2010
  • #3
Io ho provato ad inserire le funzioni java in questo modo ma non funziona esce il messaggio di errore quando non spunti la checkbox ma se la spunti non prosegue.
PHP:
<html>
<head>
<title>Titolo</title>
<META NAME="DC.Title" CONTENT="Titolo">
<META NAME="keywords" CONTENT="">
<meta name="description" content="titolo">
<meta http-equiv="Content-Language" content="IT">
<meta name="author" content="">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<script language="JavaScript">
function checkForm() { 

     form=document.modulo  //ci metti il nome del tuo form 

     if (!(form.trattamento_dati.checked)) { 

           alert("Devi accettare il trattamento dei dati"); 
           return; 
     } 
     else { 
     
        form.target = "_parent"; 
        form.action = "prova.php"; //il file che esegue lo script associato alla form 
        form.method = "POST";  //o GET 
        form.submit();     
     } 

}
</script>

<style type="text/css">
<!--
.Stile1 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 10px;
}
.Stile2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #0099FF;
}
.Stile5 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	font-size: 14px;
	color: #000000;
}
.Stile10 {color: #000000; font-family: "Times New Roman", Times, serif; }
.Stile11 {color: #000000}
.Stile14 {font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000000; }
.Stile16 {font-family: Arial, Helvetica, sans-serif; font-size: 10px; color: #000000; }
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="320" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td><?php
$passo=$_GET["passo"];
if($passo!='1'){
?>
        <form action="prova.php?passo=1" method="post" name="modulo" id="modulo">
          <table width="320" border="0" align="center" cellpadding="0" cellspacing="0">
            
            <tr>
              <td width="88" align="center" valign="top" class="testo">&nbsp;</td>
              <td width="232" align="center" valign="top" class="testo">DATI </td>
            </tr>
            <tr>
              <td width="88" align="right"><span class="Stile14">Nome e Cognome</span></td>
              <td width="232" align="right"><input name="nome" type="text" id="nome"></td>
            </tr>
            <tr>
              <td width="88" height="5" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
              <td width="232" height="5" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right"><span class="Stile14">Via</span></td>
              <td width="232" align="right"><input name="via" type="text" id="via"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right" class="Stile14">Numero</td>
              <td height="10" align="right"><input name="numero" type="text" id="numero"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right" class="Stile14">CAP</td>
              <td height="10" align="right"><input name="cap" type="text" id="cap"></td>
            </tr>
            <tr>
            <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td width="88" height="10" align="right"><span class="Stile14">Città</span></td>
              <td width="232" height="10" align="right"><input name="citta" type="text" id="citta"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right" class="Stile14">Provincia</td>
              <td height="10" align="right"><input name="provincia" type="text" id="provincia"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right"><span class="Stile14">Telefono</span></td>
              <td width="232" align="right"><input name="telfax" type="text" id="telfax"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right"><span class="Stile14">Fax</span></td>
              <td height="10" align="right"><input name="telfax2" type="text" id="telfax2"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td height="10" align="right"><span class="Stile14">Cellulare</span></td>
              <td height="10" align="right"><input name="telfax3" type="text" id="telfax3"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right"><span class="Stile14">E-mail</span></td>
              <td width="232" align="right"><input name="email" type="text" id="email"></td>
            </tr>
            <tr>
              <td height="5" colspan="2" align="right"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
            </tr>
            
            <tr>
              <td height="10" align="right" class="Stile14">Pagamento: </td>
              <td height="10" align="right"><table width="232" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="right"><span class="Stile14">Bonifico</span>
                  <input name="ctel2" type="radio" value="bonifico"></td>
                  <td align="right"><span class="Stile14">Vaglia</span>
                  <input name="ctel2" type="radio" value="vaglia"></td>
                </tr>
              </table></td>
            </tr>
            
            
            <tr>
              <td height="10" colspan="2" align="right"><img src="../../../immagini/pixel.gif" width="1" height="1"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
            </tr>

            <tr>
              <td width="88" align="right" valign="top" class="Stile14">Note</td>
              <td width="232" align="right"><textarea name="richieste" rows="8" wrap="VIRTUAL" id="richieste"></textarea></td>
            </tr>
            <tr>
              <td width="88" height="10" align="right"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
              <td width="232" height="10" align="right"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td colspan="2" align="center" valign="top" class="Stile14"><iframe frameborder="0" id="content" name="content" src="informativa.html" width="300
    " height="300" ></iframe></td>
            </tr>
            <tr>
              <td align="right" class="Stile14">Acconsento al trattamento dei dati</td>
              <td align="right"><table width="232" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td align="right"><span class="Stile14">Si </span>
                      <input type="checkbox" name="trattamento_dati"></td>
                  <td align="right">&nbsp;</td>
                </tr>
              </table></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="right">&nbsp;</td>
            </tr>
            <tr>
              <td width="88" align="right">&nbsp;</td>
              <td width="232" align="right"><input type="button" name="Invia" value="Invia" onClick="checkForm()"></td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td height="10" align="right"><input name="Submit2" type="reset" value="Annulla"></td>
            </tr>
            <tr>
              <td width="88" align="right">&nbsp;</td>
              <td width="232" height="10" align="right"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
            </tr>
          </table>
      </form>
      <?php
}else if($passo=='1'){
	$destinatario  = "<" . $_REQUEST["email"] . ">";
	$oggetto = "oggetto";
	$corpodelmessaggio = '
	<html>
	<head>
	 <title>Titolo</title>
	</head>
	<body>
	<p>Grazie per aver scelto il nostro sito </p>
	<p>Le sue richieste saranno esaudite al pi&ugrave; presto</p>
	<p>Nome</p>
	</body>
	</html>
	';
	$headers = "From: tua@mail.it\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
	//unique boundary
	$boundary = uniqid("inviodati");
	//tell e-mail client this e-mail contains//alternate versions
	$headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";
	//HTML version of message
	$body .= "--$boundary\r\n" .
	   "Content-Type: text/html; charset=ISO-8859-1\r\n" .
	   "Content-Transfer-Encoding: base64\r\n\r\n";
	$body .= chunk_split(base64_encode($corpodelmessaggio));
	//send message
	mail($destinatario, $oggetto, $body, $headers);
//seconda mail
	$oggetto = "Richiesta informazioni dal sito";
	$corpodelmessaggio = '
	<html>
	<head>
	 <title>Titolo</title>
	</head>
	<body>
	<p>Nome e cognome: ' . $_REQUEST["nome"] . '</p>
	<p>via: ' . $_REQUEST["via"] . '</p>
	<p>numero: ' . $_REQUEST["numero"] . '</p>
	<p>cap: ' . $_REQUEST["cap"] . '</p>
	<p>città: ' . $_REQUEST["citta"] . '</p>
	<p>provincia: ' . $_REQUEST["provincia"] . '</p>
	<p>Telefono: ' . $_REQUEST["telfax"] . '</p>
	<p>Fax: ' . $_REQUEST["telfax2"] . '</p>
	<p>Cellulare: ' . $_REQUEST["telfax3"] . '</p>
	<p>E-mail: ' . $_REQUEST["email"] . '</p>
	<p>tipo pagamento: ' . $_REQUEST["ctel2"] . '</p>
	<p>Acconsento al trattamento dei dati: ' . $_REQUEST["ctel3"] . '</p>
	<p>note: ' . $_REQUEST["richieste"] . '</p>
	
	</body>
	</html>
	';
	$headers = "From: tua@mail.it\r\n";
	$headers .= "MIME-Version: 1.0\r\n";
	//unique boundary
	$boundary = uniqid("inviodati");
	//tell e-mail client this e-mail contains//alternate versions
	$headers .= "Content-Type: multipart/mixed; boundary = $boundary\r\n\r\n";
	//HTML version of message
	$body .= "--$boundary\r\n" .
	   "Content-Type: text/html; charset=ISO-8859-1\r\n" .
	   "Content-Transfer-Encoding: base64\r\n\r\n";
	$body .= chunk_split(base64_encode($corpodelmessaggio));
	//send message
	mail("tua@mail.it", $oggetto, $body, $headers);
?>
        <table width="280" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><div align="center" class="titolo Stile2"><strong>Riepilogo 
            informazioni inviate</strong><br>
            </div></td>
          </tr>
          <tr>
            <td height="20">&nbsp;</td>
          </tr>
          <tr>
            <td><span class="Stile1 Stile11">Nome e cognome: </span> <span class="testo"><?php echo($_REQUEST["nome"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Via: </span> <span class="testo"><?php echo($_REQUEST["via"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Citt&agrave;: </span> <span class="testo"><?php echo($_REQUEST["citta"]) ?></span></td>
          </tr>

          <tr>
            <td height="10"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Telefono: </span> <span class="testo"><?php echo($_REQUEST["telfax"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td height="10"><span class="Stile16">Fax: </span> <span class="testo"><?php echo($_REQUEST["telfax2"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td height="10"><span class="Stile16">Cellulare: </span> <span class="testo"><?php echo($_REQUEST["telfax3"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">E-mail: </span> <span class="testo"><?php echo($_REQUEST["email"]) ?></span></td>
          </tr>
          
          
          <tr>
            <td height="10"><img src="../../../immagini/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16">Note: </span> <span class="testo"><?php echo($_REQUEST["richieste"]) ?></span></td>
          </tr>
          <tr>
            <td height="10"><img src="../immagini/e_commerce/pixel.gif" width="1" height="1"></td>
          </tr>
          <tr>
            <td><span class="Stile16"><strong>Acconsento al trattamento dei dati</strong>:<span class="testo"><?php echo($_REQUEST["ctel3"]) ?></span></span></td>
          </tr>
        </table>
    <?php
}
?>    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>

</body>
</html>
 
Devi accedere o registrarti per poter rispondere.

Discussioni simili

F
Spiegazione script java per randomizzare
  • Fabio Pastori
  • 9 Feb 2015
  • Javascript
Risposte
0
Visite
1K
Javascript 9 Feb 2015
Fabio Pastori
F
E
[JAVA] modificare Script per evento onmouseover
  • eddy
  • 21 Feb 2011
  • Javascript
Risposte
0
Visite
2K
Javascript 21 Feb 2011
eddy
E
F
  • Bloccata
Script java elenco alfabetico non funziona
  • Francesco Botteri
  • 8 Mar 2021
  • Javascript
Risposte
3
Visite
1K
Javascript 8 Mar 2021
Max 1
F
Aiuto java script
  • FrancescoCafu
  • 28 Dic 2019
  • Javascript
Risposte
2
Visite
2K
Javascript 28 Dic 2019
FrancescoCafu
F
M
[Javascript] Java card
  • mastice123
  • 27 Nov 2018
  • Java
Risposte
0
Visite
1K
Java 27 Nov 2018
mastice123
M
Aiuto script java
  • andreasuriani
  • 2 Gen 2018
  • Ajax
Risposte
1
Visite
2K
Ajax 10 Gen 2018
bubino8
[Javascript] ELSE su java script
  • trattorino
  • 4 Ott 2017
  • Javascript
Risposte
1
Visite
1K
Javascript 4 Ott 2017
criric
G
[Javascript] come si testa il codice java-sciipt
  • gio661
  • 23 Set 2017
  • Javascript
Risposte
2
Visite
1K
Javascript 24 Set 2017
gio661
G
[Javascript] Java script ritorni a capo
  • trattorino
  • 31 Mar 2017
  • Javascript
Risposte
7
Visite
4K
Javascript 31 Mar 2017
criric
[Javascript] Errore java
  • booklisa
  • 13 Gen 2017
  • Javascript
Risposte
3
Visite
2K
Javascript 26 Gen 2017
criric
[Javascript] Slide show in java script, senza array con nome visibile dell'immagine
  • Daniele450
  • 2 Nov 2016
  • Javascript
Risposte
2
Visite
2K
Javascript 6 Nov 2016
Daniele450
E
[Javascript] help me !!! array da php a java
  • echoes
  • 10 Ott 2015
  • Javascript
Risposte
9
Visite
3K
Javascript 19 Lug 2016
ottofonsuppost
A
Java to JavaScript
  • Alby2812
  • 18 Nov 2014
  • Javascript
Risposte
4
Visite
1K
Javascript 19 Nov 2014
Alby2812
A
G
script Java non visualizza i decimali :(
  • guru of future
  • 5 Ago 2013
  • Javascript
Risposte
4
Visite
2K
Javascript 6 Ago 2013
Longo8
L
Interazione Javascript con Java
  • luis20
  • 5 Nov 2012
  • Javascript
Risposte
0
Visite
1K
Javascript 5 Nov 2012
luis20
L
S
Java o Javascript?
  • scartus13
  • 3 Mar 2012
  • Javascript
Risposte
1
Visite
2K
Javascript 3 Mar 2012
borgo italia
M
Script Java giorni della settimana
  • mrcervello
  • 8 Feb 2011
  • Javascript
Risposte
0
Visite
2K
Javascript 8 Feb 2011
mrcervello
M
B
far partire il java script
  • bloom7
  • 12 Ott 2008
  • Javascript
Risposte
3
Visite
3K
Javascript 15 Ott 2008
lukeonweb
Java script, scrittura a mano
  • milly
  • 14 Ago 2006
  • Javascript
Risposte
0
Visite
2K
Javascript 14 Ago 2006
milly
G
java/javascript
  • GioFazio
  • 24 Mag 2006
  • Java
Risposte
2
Visite
3K
Java 12 Giu 2016
ottofonsuppost
Condividi:
Facebook X (Twitter) LinkedIn WhatsApp e-mail Condividi Link
  • Home
  • Forum
  • Fare Web
  • Javascript
  • Italiano
  • Termini e condizioni d'uso del sito
  • Policy Privacy
  • Aiuto
  • Home
Community platform by XenForo® © 2010-2024 XenForo Ltd. | Traduzione a cura di XenForo Italia
Menu
Accedi

Registrati

  • Home
  • Forum
    • Nuovi Messaggi
    • Cerca...
  • Novità
    • Featured content
    • Nuovi Messaggi
    • Ultime Attività
X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?

X

Privacy & Transparency

We use cookies and similar technologies for the following purposes:

  • Personalized ads and content
  • Content measurement and audience insights

Do you accept cookies and these technologies?