Salve vado subito al dunque.. perche sto impazzendo.. non ne capisco molto di php.. cmq. ho creato un form per inviare email. il form funziona pero la variante che ho messo ora e che la risposta del submit deve avvenire nella stessa pagina.. senz ricaricare. funziona in parte i problema è che rimane bloccato il messaggio email inviata.. ogni qual volta ricarico la pagina.. mi rinvia il modulo non calcolando il submit. aiutatemi questo è il codice.
casebioedilizia.com/schede arredo.html
qui il codice.
[html]<?php
// L'INDIRIZZO DEL DESTINATARIO DELLA MAIL
$to = "<mail>";
// IL SOGGETTO DELLA MAIL
$subject = "RICHIESTA PRODOTTO - TECNOWOODSHOP.IT";
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body = "Contenuto del modulo:\n\n";
$body .= "Dati personali ;\nCognome: " . trim(stripslashes($_POST["cognome"])) . "\n";
$body .= "Nome: " . trim(stripslashes($_POST["nome"])) . "\n";
$body .= "Indirizzo: " . trim(stripslashes($_POST["indirizzo"])) . "\n";
$body .= "Tel: " . trim(stripslashes($_POST["tel"])) . "\n";
$body .= "Mail: " . trim(stripslashes($_POST["mail"])) . "\n";
$body .= "Prodotto: " . trim(stripslashes($_POST["prodotto"])) . "\n";
$body .= "Ricevere Newsletter?: " . trim(stripslashes($_POST["new"])) . "\n\n";
// INTESTAZIONI SUPPLEMENTARI
$headers = "From: Modulo utenti <INDIRIZZO-COME-SOPRA>";
// INVIO DELLA MAIL
if(@mail($to, $subject, $body, $headers)) { // SE L'INOLTRO E' ANDATO A BUON FINE...
echo "MAIL INOLTRATA.";
} else {// ALTRIMENTI...
echo "ERRORE MAIL.";
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CONTATTACI</title>
<link rel="icon" href="img/ico.png" type="image/png">
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body style="margin:0; color: #fff; font-size:10px;">
<form name="form1" method="post" action="<?php echo ($_SERVER["PHP_SELF"]); ?>">
<table width="160" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="55" height="25" align="right" style="padding-right: 5px; color:#fff; font-size:11px">Nome: </td>
<td height="25" align="right" style="padding-right: 5px;"><input name="nome" type="text" size="10" /></td>
</tr>
<tr>
<td height="25" align="right" style="padding-right: 5px; color:#fff; font-size:11px">Cognome:</td>
<td align="right" style="padding-right: 5px;"><input name="cognome" type="text" size="10" /></td>
</tr>
<tr>
<td height="25" align="right" style="padding-right: 5px; color:#fff; font-size:11px">Indirizzo:</td>
<td align="right" style="padding-right: 5px;"><input name="indirizzo" type="text" size="10" /></td>
</tr>
<tr>
<td height="25" align="right" style="padding-right: 5px; color:#fff; font-size:11px">Tel:</td>
<td align="right" style="padding-right: 5px;"><input name="tel" type="text" size="10" /></td>
</tr>
<tr>
<td height="25" align="right" style="padding-right: 5px; color:#fff; font-size:11px">Email:</td>
<td align="right" style="padding-right: 5px;"><input name="mail" type="text" size="10" /></td>
</tr>
<tr>
<td height="25" colspan="2" align="right" style="padding-right: 5px;"><select name="prodotto" style="width: 140px; font-size:11px">
<option>Seleziona il prodotto</option>
<option value="Armadio 2 ante con casetti - Noce / H 186">Noce / H 186</option>
<option value="Armadio 2 ante con casetti - Noce / H 224">Noce / H 224</option>
<option value="Armadio 2 ante con casetti - Bianco / H 186">Bianco / H 186</option>
</select> </td>
</tr>
<tr>
<td height="25" colspan="2" align="center" style="padding-right: 5px; color:#fff; font-size:11px"><input style=" border-color:#EAEAEA" type="checkbox" name="new" value="Si"/>
Ricevere News-letter</td>
</tr>
<tr>
<td height="25" colspan="2" align="center" valign="bottom"><input type="submit" name="submit" value="INVIA" style="bacbackground-attachment: scroll;
background-clip: border-box;
background-color:;
border-color: #404040;
border-style: solid;
border-width: 1px;
color: #202020;
text-align: center;
width: 70px;
height: 18px;
font-size:10px;" /></td>
</tr>
</table>
</form>
</body>
</html>[/html]
grazie anticipatamente.. so che trovere la soluzione.