?
function is_mail($nomchp) {
return ereg("^([a-zA-Z0-9]{1,})((\.|-|_)[a-zA-Z0-9]{1,})*@([a-zA-Z0-9]{1,})((\.|-|_)[a-zA-Z0-9]{1,})*(\.([a-zA-Z]{2,3}))$",$nomchp);
}
$cryptinstall="crypt/cryptographp.fct.php";
require_once $cryptinstall;
if(isset($_POST['btContact'])){
$nom = trim($_POST['nom']);$prenom = trim($_POST['prenom']); $adresse = trim($_POST['adresse']); $cp = trim($_POST['cp']);
$ville = trim($_POST['ville']); $tel = trim($_POST['tel']); $fax = trim($_POST['fax']); $email = trim($_POST['email']); $message = trim($_POST['message']);
if($nom == ""){$manque_nom = true;}
if($adresse == ""){$manque_adresse = true;}
if($cp == ""){$manque_cp = true;}
if($ville == ""){$manque_ville = true;}
if($tel == ""){$manque_tel = true;}
if(!is_mail($email)){$mail_faux = true;}
if (!chk_crypt($_POST['code'])){$code_faux=true;}
if(!$manque_nom && !$manque_adresse && !$manque_cp && !$manque_ville && !$manque_tel && !$mail_faux && !$code_faux){
//on envoie le mail
$message=ereg_replace("\r","",$message);
$message=ereg_replace("\n","
",$message);
$maintenant = date("d/m/Y H:i:s",time());
$body.= "
"; $body.="$maintenant - NOUVEAU CONTACT DEPUIS LE SITE : location-vacances-avoriaz.com - DE : $civilite $nom $prenom Adresse : ".nl2br($adresse)." Code Postal : $cp Ville : $ville Tel : $tel Fax : $fax Email : $email "; $body.= "MESSAGE : $message"; $body.= " |
|