diff options
Diffstat (limited to '')
-rw-r--r-- | Html/contact.php | 152 |
1 files changed, 152 insertions, 0 deletions
diff --git a/Html/contact.php b/Html/contact.php new file mode 100644 index 0000000..58f7def --- /dev/null +++ b/Html/contact.php @@ -0,0 +1,152 @@ +<?php +require_once 'includes/config.php'; + +//Titre de la page +$pagetitle = 'Contactez-nous !'; + +//Stats : bbclone +define("_BBC_PAGE_NAME", $pagetitle); +define("_BBCLONE_DIR", "bbclone/"); +define("COUNTER", _BBCLONE_DIR."mark_page.php"); +if (is_readable(COUNTER)) include_once(COUNTER); + +include_once 'includes/header.php'; +?> + +<body> + +<div id="container"> + + <?php + include_once 'includes/header-logo.php'; + include_once 'includes/nav.php'; + ?> + + <div id="body"> + <div id="content"> + + <?php + include_once 'includes/ariane.php'; + ?> + + +<?php +// Affichage : message envoyé ! +if(isset($_GET['action'])){ + echo '<div class="alert-msg rnd8 success">Votre message a bien été envoyé !<br />Nous y répondrons dès que possible !</div>'; +} +?> + +<?php +if(isset($_GET['wrong_code'])) { + echo '<br /><div class="alert-msg rnd8 error">Mauvais code anti-spam !</div>'; +} +?> + + +<?php +//if form has been submitted process it +if(isset($_POST['submit'])) { + + $name = html($_REQUEST["name"]); + $subject = html($_REQUEST["subject"]); + $message = nl2br(bbcode($_REQUEST["message"])); + $from = html($_REQUEST["from"]); + $verif_box = $_REQUEST["verif_box"]; + + + if($name ==''){ + $error[] = 'Veuillez entrer un pseudo.'; + } + + if($from ==''){ + $error[] = 'Veuillez entrer une adresse e-mail.'; + } + + if($subject ==''){ + $error[] = 'Veuillez préciser un sujet.'; + } + + if($message ==''){ + $error[] = 'Votre message est vide ?!?'; + } + + + if(md5($verif_box).'a4xn' == $_COOKIE['tntcon']) { + if(!isset($error)) { + $message = "Nom: ".$name."\n".$message; + $message = "De: ".$from."\n".$message; + mail(SITEMAIL, 'Message depuis '.SITENAMELONG.' : '.$subject, $_SERVER['REMOTE_ADDR']."\n\n".$message, "From: $from"); + header("Location: contact.php?action=ok"); + setcookie('tntcon',''); + } + } + + else { + $error[] = 'Mauvais code anti-spam!'; + } +} + + if(isset($error)) { + foreach($error as $error){ + echo '<div class="alert-msg rnd8 error">'.$error.'</div>'; + } + } +?> + +<h3>Nous contacter :</h3> +<p>Merci d'utiliser le formulaire ci-dessous pour nous contacter :</p> + +<form action="" method="post"> + +Votre nom :<br /> +<?php + $nom = isset($_POST['name']) ? $_POST['name'] : ''; +?> +<input name="name" type="text" value="<?php echo html($nom); ?>"/> +<br /> +<br /> + +Votre e-mail :<br /> +<?php + $de = isset($_POST['from']) ? $_POST['from'] : ''; +?> +<input name="from" type="text" value="<?php echo html($de); ?>"/> +<br /> +<br /> + +Sujet :<br /> +<?php + $sujet = isset($_POST['subject']) ? $_POST['subject'] : ''; +?> +<input name="subject" type="text" value="<?php echo html($sujet); ?>"/> +<br /> +<br /> + +Anti-spam : veuillez recopier le code ci-dessous<br /> +<input name="verif_box" type="text"/> + <img src="verificationimage.php?<?php echo rand(0,9999);?>" alt="verification" width="50" height="24" align="absbottom" /> + <br /> + <br /> + +Message :<br /> + +<textarea name="message" style="height:300px;width:915px;"></textarea> + +<p><input name="submit" class="searchsubmit formbutton" type="submit" value="Envoyer le message"/> <input type="reset" value="Annuler" /></p> +</form> + + </div> + + <?php require('sidebar.php'); ?> + + <div class="clear"></div> + </div> +</div> + +<div id="footer"> + <?php require('includes/footer.php'); ?> +</div> + +</body> +</html> |