allora ho un codice form mail in css js ed php.....mi funziona benissimo....tranne un piccolissimo paricolare.....mi ariva alla posta indesiderata....o come spam.....
il cod. e questo:
come faccio?????codice:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento senza titolo</title> <style type="text/css"> <!-- input { display:block; padding: 3px 0 3px 5px; background-color: #FFF; border:#900 solid 2px; font-family:Verdana, Geneva, sans-serif; font-size:0.8em; margin:5px 0 5px 0; color: #000; } .invia { cursor: pointer; } textarea { display:block; padding: 3px 0 3px 5px; background-color:#FFF; border:#900 solid 2px; font-family:Verdana, Geneva, sans-serif; font-size:.8em; margin:5px 0 5px 0; } #modulo { width: 500px; background-color:#3FC; margin: 150px auto; filter:alpha(opacity=60); /*per effetto alpha al modulo*/ } span { font-size:18px; } --> #modalContainer { background-color:transparent; position:absolute; width:100%; height:100%; top:0px; left:0px; z-index:10000; background-image:url(tp.png); /* required by MSIE to prevent actions on lower z-index elements */ } #alertBox { position:relative; width:300px; min-height:100px; margin-top:50px; border:2px solid #000; background-color:#F2F5F6; background-image:url(alert.png); background-repeat:no-repeat; background-position:20px 30px; } #modalContainer > #alertBox { position:fixed; } #alertBox h1 { margin:0; font:bold 0.9em verdana,arial; background-color:#78919B; color:#FFF; border-bottom:1px solid #000; padding:2px 0 2px 5px; } #alertBox p { font:0.7em verdana,arial; height:50px; padding-left:5px; margin-left:55px; } #alertBox #closeBtn { display:block; position:relative; margin:5px auto; padding:3px; border:2px solid #000; width:70px; font:0.7em verdana,arial; text-transform:uppercase; text-align:center; color:#FFF; background-color:#78919B; text-decoration:none; } /* unrelated styles */ #mContainer { position:relative; width:600px; margin:auto; padding:5px; border-top:2px solid #000; border-bottom:2px solid #000; font:0.7em verdana,arial; } h1,h2 { margin:0; padding:4px; font:bold 1.5em verdana; border-bottom:1px solid #000; } code { font-size:1.2em; color:#069; } #credits { position:relative; margin:25px auto 0px auto; width:350px; font:0.7em verdana; border-top:1px solid #000; border-bottom:1px solid #000; height:90px; padding-top:4px; } #credits img { float:left; margin:5px 10px 5px 0px; border:1px solid #000000; width:80px; height:79px; } .important { background-color:#F5FCC8; padding:2px; } code span { color:green; } </style> <script type="text/javascript"> var ALERT_TITLE = "Messaggio!"; var ALERT_BUTTON_TEXT = "Ok"; if(document.getElementById) { window.alert = function(txt) { createCustomAlert(txt); } } function createCustomAlert(txt) { d = document; if(d.getElementById("modalContainer")) return; mObj = d.getElementsByTagName("body")[0].appendChild(d.createElement("div")); mObj.id = "modalContainer"; mObj.style.height = d.documentElement.scrollHeight + "px"; alertObj = mObj.appendChild(d.createElement("div")); alertObj.id = "alertBox"; if(d.all && !window.opera) alertObj.style.top = document.documentElement.scrollTop + "px"; alertObj.style.left = (d.documentElement.scrollWidth - alertObj.offsetWidth)/2 + "px"; alertObj.style.visiblity="visible"; h1 = alertObj.appendChild(d.createElement("h1")); h1.appendChild(d.createTextNode(ALERT_TITLE)); msg = alertObj.appendChild(d.createElement("p")); //msg.appendChild(d.createTextNode(txt)); msg.innerHTML = txt; btn = alertObj.appendChild(d.createElement("a")); btn.id = "closeBtn"; btn.appendChild(d.createTextNode(ALERT_BUTTON_TEXT)); btn.href = ""; btn.focus(); btn.onclick = function() { removeCustomAlert();return false; } alertObj.style.display = "block"; } function removeCustomAlert() { document.getElementsByTagName("body")[0].removeChild(document.getElementById("modalContainer")); } </script> </head> <body background="sfondo.JPG"> <div id="modulo"> <form method="post" action=""> <span>Nome</span> <input type="text" name="nome" /> <span>Email</span><font color="#FF0000">*</font><input type="text" name="email" /> <span>Messaggio</span> <textarea name="commenti" cols="40" rows="5"> </textarea> <input type="submit" value="Invia messaggio" class="invia" name="send_email" /> </form> </div> <?php if(isset($_POST['send_email'])) { $popup_nome = "<script>alert('Inserire il nome')</script>"; $popup_email = "<script>alert('Inserire email corretta')</script>"; $popup_commenti = "<script>alert('Inserire il testo')</script>"; $popup_ok = "<script>alert('Grazie per averci contattato. Entro 24 ore verrai ricontattato')</script>"; $destinatario = "<xxx@hotmail.it>"; $oggetto = "Richiesta Informazioni dal sito xxx"; $nome = $_POST["nome"]; $email = $_POST["email"]; $commenti = $_POST["commenti"]; if (nome == '') { echo "<div>".$popup_nome."</div>"; } if (!eregi("^[a-z0-9][_.a-z0-9-]+@([a-z0-9][0-9a-z-]+.)+([a-z]{2,4})", $email)){ echo "<div>".$popup_mail."</div>"; } if (commenti == '') { echo "<div>".$popup_commenti."</div>"; } else { $messaggio = "Dati utente: $nome\n Email: $email\n Messaggio: $commenti\n" ; $email .= " <$email>"; mail ($destinatario,$oggetto,$messaggio,"From: $nome <$email>"); echo "<div>".$popup_ok."</div>"; } } ?> </html>

Rispondi quotando