Ciao ragazzi...ho due pagine...una con un form e una con lo script php che invia i dati alla mia mail...tuttavia mi da un errore...HELP!
Prima pagina (quella con il form):

codice:
<html>

<head>
<meta http-equiv="Content-Language" content="it">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>CONTATTI</title>
</head>

<body>

<form method="POST" action="http://xxxxxxxxxx/sendate.php">
	

<font face="Calibri" style="font-size: 15pt">CONTATTI: </font></p>
	<table border="0" width="46%" id="table1" style="font-family: Calibri; font-size: 12pt; font-style: oblique" height="340">
		<tr>
			<td width="149">Nome</td>
			<td><input type="text" name="name" size="38"></td>
		</tr>
		<tr>
			<td width="149">Cognome</td>
			<td><input type="text" name="lname" size="38"></td>
		</tr>
		<tr>
			<td width="149">Email</td>
			<td><input type="text" name="email" size="38"></td>
		</tr>
		<tr>
			<td width="149">Telefono</td>
			<td><input type="text" name="tel" size="38"></td>
		</tr>
		<tr>
			<td width="149">Motivo del contatto:</td>
	<td>		<select name="motivo">
	<option value="commerciale">Informazioni commerciali</option>
	<option value="preventivo">Richiesta preventivo</option>
	<option value="appuntamento">Prenotazione appuntamento</option>
</select></td>
		</tr>

		<tr>
			<td width="149">Messaggio:</td>
			<td><textarea rows="11" name="mess" cols="29"></textarea></td>
		</tr>
	</table>
<INPUT type="submit" value="Invia">
</form>

</body>

</html>
Seconda pagina (quella che elabora la script php):

Codice PHP:
<?php
$nome
=$_POST['name'];
$cognome=$_POST['lname'];
$email=$_POST['email'];
$telefono=$_POST['tel'];
$motivo=$_POST['motivo'];
$messaggio=$_POST['mess'];


if(
$name!=null and $cognome!=null and $email!=null and $telefono!=null and $messaggio!=null){//se tutte le variabili sono state definite propongo il link
 
$to "xxxxxxxxxxx@gmail.com"
 
// IL SOGGETTO DELLA MAIL
 
$subject "Modulo proveniente dal sito [url]www.studio.it[/url]"
 
 
// COSTRUZIONE DEL CORPO DEL MESSAGGIO
$body “Contenuto del modulo:\n\n”;

$body .= “Dati personali ;
nome” trim(stripslashes($_POST["name"])) . \n”;
$body .= “cognome” trim(stripslashes($_POST["lname"])) . \n”;
$body .= “email” trim(stripslashes($_POST["email"])) . \n”;
$body .= “telefono” trim(stripslashes($_POST["tel"])) . \n”;
$body .= “motivo” trim(stripslashes($_POST["motivo"])) . \n”;
$body .= “messaggio” trim(stripslashes($_POST["mess"])) . \n”;

if(@
mail($to$subject$body)) { // SE L’INOLTRO E’ ANDATO A BUON FINE…

echo “La mail è stata inoltrata con successo!;

} else {
// ALTRIMENTI…

echo “Si sono verificati dei problemi nell’invio della mail.;
}

}else{
echo 
“Invio dati fallitoprego riempire tutti i campi e riprocedere”;
}
?>
In più mi piacerebbe inserire il controllo tramite immagine captcha o tramite la somma di due valori...
Dove posso sistemare il codice??
Dopo che lo script controlla che tutti i campi sono pieni (come ultimo controllo all'invio??)?
Cioè...invece che inviare l'email dopo l'else metto un'altra if???
Aiuttttt!