voici le code php
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: http://www.xxxx.com';
$to = '[email protected]';
$subject = 'Hello';
$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://www.xxxx.com/redirect2.html");
} else {
echo 'Formulaire incomplet !';
}
} else if ($_POST['submit'] && $antispam != '4') {
echo 'Mauvais calcul, recommencez !';
}
?>
voici le code html
<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>
<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.xxxx.com/customform/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>