Ik tracht een webformulier aan te maken in een info html pagina
alles lukt en de email ontvang ik wel maar echter zonder de invulling,
kan iemand mij helpen wat ik verkeerd doe
hml code :
<div class="col-md-7">
<form id="form" method="post" action="form_mailer.php" class="wpcf7-form">
<div class="contact-item field-full">
<textarea id="message" name="message" type="text" cols="40" rows="10" placeholder="info *"></textarea>
</div>
<div class="contact-item">
<input id="name" name="name" type="text" placeholder="Naam *" required>
</div>
<div class="contact-item">
<input id="email" name="email" type="email" placeholder="Email *"required>
</div>
<div class="contact-item">
<input id="website" name="website" type="text" placeholder="Website">
</div>
<div class="contact-item form-submit">
<input id="submit" name="submit" type="submit" formenctype="text/plain" formmethod="POST" title="invulformulier website" value="verstuur">
</div>
</form>
</div>
PHP code :
<?php
/* These are the variable that tell the subject of the email and where the email will be sent.*/
$emailSubject = 'website formulier';
$mailto = 'info@**knip**.be';
/* These will gather what the user has typed into the fieled. */
$messageField = $_POST['message'];
$nameField= $_POST['name'];
$emailField = $_POST['email'];
$websiteField = $_POST['website'];
/* This takes the information and lines it up the way you want it to be sent in the email. */
$body = <<<EOD
<br><hr><br>
Info : $messageField <br>
Name : $nameField <br>
Email : $emailField <br>
Website : $websiteField <br>
<br><hr><br>
EOD;
$headers = "From: $emailField\r\n"; // This takes the email and displays it as who this email is from.
$header .= "Content-type: text/html; charset=iso-8859-1\r\n"; // This tells the server to turn the coding into the text.
$header .= "MIME-Version: 1.0\r\n";
$header .= "X-Priority: 2\r\n"; # 1 voor erg belangrijk
$header .= "X-MSMail-Priority: High\r\n";
$header .= "X-Mailer: PHP/".phpversion();
$success = mail($mailto, $emailSubject, $body, $header); // This tells the server what to send.
$theResults = <<<EOD
EOD;
echo "$theResults";
?>
<html>
<body>
Your message was successfully sent!<br />
<br />
Thank you for contacting us!
</body>
</html>