1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| <?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: <a href="http://'mon site';" target="_blank">'mon site';</a>
$to = 'email de mon site';
$subject = 'Le club a été contacté ';
$human = $_POST['antispam'];
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
if ($_POST['submit'] && $antispam == '4') {
if (mail ($to, $subject, $body, $from)) {
header("location:http://monsite.com/redirect2.html");
} else {
echo 'Formulaire incomplet !';
}
} else if ($_POST['submit'] && $antispam != '4') {
echo 'Mauvais calcul, recommencez !';
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="iso-8859-1" />
<link rel="stylesheet" type="text/css" href="formulaire.css">
<link rel="stylesheet" type="text/css" href="modal.css">
</head>
<body>
<a href="#openModal">Open Modal</a>
<div id="openModal" class="modalDialog">
<div>
<a href="#close" title="Close" class="close"></a>
<header class="body">
Formulaire:
</header>
<section class="body">
<form method="post" action="http://www.monsite.com/index.php">
<label>NOM,Prénom :</label>
<input name="name" placeholder="Ecrivez ici">
<label>Email :</label>
<input name="email" type="email" placeholder="Ecrivez ici">
<label>Votre message :</label>
<textarea name="message" placeholder="Ecrivez ici"></textarea>
<label>Que donne 2+2 ?</br> (Anti-spam)</label>
<input name="antispam" placeholder="Résultats">
<input id="submit" name="submit" type="submit" value="Submit">
</form>
</section>
<footer class="body">
</footer>
</div>
</div>
</body>
</html>
</body>
</html> |
Partager