ciao a tutti!
innanzi tutto spero di aver postato nel forum giusto..
e adesso vengo a spiegare il mio quesito!
allora, sto organizzando una iscrizione a un house organ, vorrei fare la pagina di richiesta arretrati tramite inserimento di nome utente e password usati per la registrazione, cosi da sapere chi richiede gli arretrati.
il problema sta nel fatto che devo fare un controllo incrociato su nome utente e password inserita, innanzi tutto devono esistere tutte e due, e poi devono essere associate a coppie.
io per l'invio dei dati del form uso una pagina con codice asp, ma prima di effettuare l'invio ovviamente devo passare un controllo sull'esistenza dei dati immessi.
come si fa??
di seguito il codice usato su pagina del form e pagina asp:
javascript pagina form controllo campi e invio
codice:<script language="javascript"> <!-- function Modulo() { // Variabili associate ai campi del modulo var email = document.modulo.email.value; var codice = document.modulo.codice.value; // Espressione regolare dell'email var email_reg_exp = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/; //Effettua il controllo sul campo NOME if (!email_reg_exp.test(email) || (email == "") || (email == "undefined")) { alert("Inserire un indirizzo email corretto."); document.modulo.email.select(); return false; } if ((codice == "") || (codice == "undefined")) { alert("Il campo Codice è obbligatorio."); document.modulo.codice.focus(); return false; } //INVIA IL MODULO else { document.modulo.action = "spedisci_arretrati_fiori.asp"; document.modulo.submit(); } } function MM_preloadImages() { //v3.0 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}} } function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc; } function MM_findObj(n, d) { //v4.01 var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n]; for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); if(!x && d.getElementById) x=d.getElementById(n); return x; } function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3) if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];} } //--> </script>
CODICE FORM
codice:<form name="modulo" method="post"> <table width="500" border="0" cellspacing="0" cellpadding="0"> <tr> <td height="65" colspan="2" align="left" valign="top" class="bianco">Seleziona i numeri arretrati che vuoi ricevere <span class="arancio">*</span>e inserisci l'indirizzo mail che hai utilizzato al momento dell' iscrizione e il codice personale che ti abbiamo inviato per confermare la tua registrazione.</td></tr><tr> <td width="250" height="180" align="center" valign="top"><table width="150" border="0" cellpadding="0" cellspacing="0" class="bianco"><tr height="25"> <td height="25">settembre N. 1</td> <td height="25"><input type="checkbox" name="checkboxName2" value="numero 1" /></td> </tr> <tr height="25"> <td height="25">ottobre N. 2</td> <td height="25"><input type="checkbox" name="checkboxName2" value="numero 2" /></td> </tr> <tr height="25"> <td height="25">novembre N. 3</td> <td height="25"><input type="checkbox" name="checkboxName2" value="numero 3" /></td> </tr> <tr height="25"> <td height="25">dicembre N. 4</td> <td height="25"><input type="checkbox" name="checkboxName2" value="numero 4" /></td> </tr> <tr height="25"><td height="25">gennaio N. 5</td><td height="25"><input type="checkbox" name="checkboxName2" value="numero 5" /></td> </tr> <tr height="25"> <td height="25">febbraio N. 6</td> <td height="25"><input type="checkbox" name="checkboxName2" value="numero 6" /></td> </tr> </table></td> <td width="250" height="180" align="center" valign="top"><table width="150" border="0" cellpadding="0" cellspacing="0" class="bianco"> <tr height="25"><td height="25">marzo N. 7</td> <td height="25"><input type="checkbox" name="checkboxName" value="numero 7" /></td> </tr> <tr height="25"> <td height="25">aprile N. 8</td> <td height="25"><input type="checkbox" name="checkboxName" value="numero 8" /></td> </tr> <tr height="25"> <td height="25">maggio N. 9</td> <td height="25"><input type="checkbox" name="checkboxName" value="numero 9" /></td> </tr> <tr height="25"> <td height="25">giugno N. 10</td> <td height="25"><input type="checkbox" name="checkboxName" value="numero 10" /></td> </tr> <tr height="25"> <td height="25">agosto N. 11</td> <td height="25"><input type="checkbox" name="checkboxName" value="numero 11" /></td> </tr> <tr height="25"> <td height="25">settembre N. 12</td> <td height="25"><input type="checkbox" name="checkboxName" value="numero 12" /></td> </tr> </table></td> </tr><tr> <td width="250" height="30" align="right" valign="bottom" class="bianco">E-mail <span class="arancio">*</span></td> <td width="250" height="30" align="left" valign="bottom" class="main"><input name="email" type="text" class="textfield" id="email" /></td> </tr><tr> <td width="250" height="30" align="right" valign="bottom" class="bianco">Codice personale <span class="arancio">*</span></td> <td width="250" height="30" align="left" valign="bottom" class="main"><input name="codice" type="password" class="textfield" id="codice" /></td></tr><tr> <td width="250" height="35"></td> <td width="250" height="35"></td> </tr><tr> <td height="50" colspan="2" align="center" valign="middle"><span class="invia"> <input name="B12" type="button" class="invia" value="INVIA" onclick="Modulo()" /> </span>[img]images/trasp.gif[/img]<span class="invia"><input name="invia2" type="reset" class="invia" id="invia2" value="RESET" /></span></td></tr><tr><td height="50" colspan="2" align="center" valign="bottom" class="bianco">I campi contrassegnati con <span class="arancio">*</span> sono obbligatori.</td></tr> </table></form>
CODICE ASP INVIO DATI VIA MAIL
codice:<% HTML = "<!DOCTYPE HTML PUBLIC""-//IETF//DTD HTML//EN"">" HTML = HTML & "<html>" HTML = HTML & "<head>" HTML = HTML & "<meta http-equiv=""Content-Type""" HTML = HTML & "content=""text/html; charset=iso-8859-1"">" HTML = HTML & "<meta name=""GENERATOR""" HTML = HTML & " content=""Microsoft Visual Studio 6.0"">" HTML = HTML & "<title>HTMLMail</title>" HTML = HTML & "</head>" HTML = HTML & "<body bgcolor=""FFFFFF"">" HTML = HTML & " Vi ha scritto il signor " & request.form("email") & "</p> CODICE PERSONALE: " & request.form("codice") & "</p> richiesta numeri arretrati: </p> numero 1: " & request.form("numero 1") & "</p> numero 2: " & request.form("numero 2") & "</p> numero 3: " & request.form("numero 3") & "</p> numero 4: " & request.form("numero 4") & "</p> numero 5: " & request.form("numero 5") & "</p> numero 6: " & request.form("numero 6") & "</p> numero 7: " & request.form("numero 7") & "</p> numero 8: " & request.form("numero 8") & "</p> numero 9: " & request.form("numero 9") & "</p> numero 10: " & request.form("numero 10") & "</p> numero 11: " & request.form("numero 11") & "</p> numero 12: " & request.form("numero 12") HTML = HTML & "</body>" HTML = HTML & "</html>" Set objNewMail = Server.CreateObject("Persits.MailSender") objNewMail.Host = "smtp.nsoft.it" objNewMail.IsHTML = True objNewMail.From = "MIAMAIL@XXXXXX.IT" objNewMail.AddAddress"MIAMAIL@XXXXXX.IT" objNewMail.Subject = "BEEP! - RICHIESTA ISCRIZIONE - AZIENDA" objNewMail.Body = HTML objNewMail.Send Set objNewMail = Server.CreateObject("Persits.MailSender") objNewMail.Host = "smtp.nsoft.it" objNewMail.IsHTML = True objNewMail.From = "MIAMAIL@XXXXXX.IT" objNewMail.AddAddress request.form("email") objNewMail.Subject = "BEEP! - RICHIESTA ARRETRATI" objNewMail.Body = "Grazie per aver compilato il form per la richiesta degli arretrati di BEEP!" objNewMail.Send %>

Rispondi quotando
