<?php
$name=urlencode(strip_tags($_POST['name']));
$date=urlencode(strip_tags($_POST['date']));
$posti=urlencode(strip_tags($_POST['posti']));
$phone=urlencode(strip_tags($_POST['phone']));
$email=urlencode(strip_tags($_POST['email']));
$ok=1;
$tname=1;
$tdate=1;
$tposti=1;
$tphone=1;
$temail=1;
$ok_contact=1;
if(urldecode($name)!="your name"){}else{$ok=0;$tname=0;}
if(urldecode($date)!="when and hour"){}else{$ok=0;$tdate=0;}
if(urldecode($posti)!="places"){}else{$ok=0;$tposti=0;}
//uno dei due deve essere pieno
if((urldecode($phone)!="telephone number")||(urldecode($email)!="e-mail")){$ok_contact=1;}else{$ok=0;$ok_contact=0;}
if($ok_contact==0){if(urldecode($phone)=="telephone number"){$tphone=0;}}else{if(urldecode($phone)=="telephone number")$phone="";}
if($ok_contact==0){if(urldecode($email)=="e-mail"){$temail=0;}}else{if(urldecode($email)=="e-mail")$email="";}
?>
<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 = $name." ".$posti." ".$date;
$body = $name." - persone: ".$posti." - ".$date." - tel: ".$phone." - mail: ".$email;
if($ok==1){
if (mail($to, $subject, $body)) {
$temp="<br><br><b>LE SUE PRENOTAZIONI SONO STATE INVIATE:</b><br><b>".$name."</b><br>persone: <b>".$posti."</b><br><b>".$date."</b><br>tel: <b>".$phone."</b><br>mail: <b>".$email."</b></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: la prenotazione non è stata inoltrata</p>";
echo '
<form method="POST" action="../prenota_adesso.php">
<div style="float: left; color: #8d1717; font-size: 17px; width: 70px;">nome</div><input style="color: gray; float: left; margin-left: 70px;" type="text" size="50" value="'.urldecode($name).'" name="name">'; if($tname==0)echo '<img src="alert.gif">'; echo '<div style="clear: both;"></div>
<div style="float: left; color: #8d1717; font-size: 17px; width: 70px;">giorno/ora</div><input style="color: gray; float: left; margin-left: 70px;" type="text" size="50" value="'.urldecode($date).'" name="date">'; if($tdate==0)echo '<img src="alert.gif">'; echo '<div style="clear: both;"></div>
<div style="float: left; color: #8d1717; font-size: 17px; width: 70px;">n posti</div><input style="color: gray; float: left; margin-left: 70px;" type="text" size="50" value="'.urldecode($posti).'" name="posti">'; if($tposti==0)echo '<img src="alert.gif">'; echo '<div style="clear: both;"></div>
<div style="float: left; color: #8d1717; font-size: 17px; width: 70px;">telefono</div><input style="color: gray; float: left; margin-left: 70px;" type="text" size="50" value="'.urldecode($phone).'" name="phone">'; if($tphone==0)echo '<img src="alert.gif">'; echo '<div style="clear: both;"></div>
<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;"> </div><input style="color: #8d1717; float: left; margin-left: 70px;" type="submit" value="submit">
</form>
';
}
?>
</div>
</body>
Nessun commento:
Posta un commento