lunedì 28 marzo 2011

FORM CONTATTI

<?php

$email=urlencode(strip_tags($_POST['email']));
$testo=urlencode(strip_tags($_POST['testo']));

$ok=1;
$ttesto=1;
$temail=1;
$ok_contact=1;
if(urldecode($email)!="e-mail"){}else{$ok=0;$temail=0;}
if(urldecode($testo)!="your-text"){}else{$ok=0;$ttesto=0;}

?>
<body style="background-image: url('templates/beez/images/tessuto.jpg'); color: #8d1717; font-size: 17px;">
<div style="padding: 20px;">
<img src='templates/beez/images/home.jpg'>
<?php

$to = "maxxflyer@gmail.com";
 $subject = "LA CAPRIATA RICHIESTA INFORMAZIONI";
 $body = $testo."\n".$email;
if($ok==1){
 if (mail($to, $subject, $body)) {
  $temp="<br><br><b>RICHIESTA INVIATA:</b><br>from: <b>".$email."</b><br>testo: <b>".$testo."</b>";
echo urldecode($temp);
  } else {
   echo("<p>Problemi con la spedizione, vi preghiamo di riprovare piu tardi...</p>");
  }
}else{echo "<p>Alcuni dei campi sono incompleti, vi preghiamo di completarli correttamente: il tuo messaggio non e' stato inoltrato</p>";
echo '
<form method="POST" action="../scrivici_adesso.php">

<div style="float: left; color: #8d1717; font-size: 17px; width: 70px;">e-mail</div><input  style="color: gray; float: left; margin-left: 70px;" type="text" size="50" value="'.urldecode($email).'" name="email">'; if($temail==0)echo '<img src="alert.gif">'; echo '<div style="clear: both;"></div>
<div style="float: left; color: #8d1717; font-size: 17px; width: 70px;">testo</div><textarea style="color: gray; float: left; margin-left: 70px;" type="text" cols="38"  rows="5"  name="testo">'.urldecode($testo).'</textarea>'; if($ttesto==0)echo '<img src="alert.gif">'; echo '<div style="clear: both;"></div>
<div style="float: left; color: #8d1717; font-size: 17px; width: 70px;">&nbsp;</div><input style="color: #8d1717; float: left; margin-left: 70px;" type="submit" value="submit">
</form>
';

}



?>
</div>
</body>

Nessun commento:

Posta un commento