php form variables are not included in email
Hello,
I made a form in html with an php linked to it, so people can fill out my contact form and I get an email. However, my variables are not inlcuded in the mail I get...
Can you guys help me?
Hello,
I made a form in html with an php linked to it, so people can fill out my contact form and I get an email. However, my variables are not inlcuded in the mail I get...
Can you guys help me?
De markup (HTML)
<form method="" name="myemailform" action="email-form.php">
<div class="form-group">
<input type="name" class="form-control form-control-white" id="name" placeholder="Uw naam" name="fullname" required/>
</div>
<div class="form-group">
<input name="email" type="email" required class="form-control form-control-white" id="email" placeholder="Email"/>
</div>
<div class="form-group">
<input type="message" class="form-control form-control-white" id="message" placeholder="Bericht" name="message" required/>
</div>
<input type="submit" class="btn btn-o-white" value="Verstuur"/>
</form>
email-form.php
<?php
$Subject = 'ingevuld formulier op de website';
$webmaster = 'info@xxxxxxxxrs.be';
$emailfield = $_POST['email'];
$namefield = $_POST['fullname'];
$messagefield = $_POST['message'];
$body = <<<EOD
<br><hr><br>
Email: $emailfield <br>
Naam: $namefield <br>
Bericht: $messagefield <br>
EOD;
$headers = "From: $emailfield\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webmaster, $Subject, $body, $headers);
echo "Bedankt voor uw bericht! Klik <a href='http://www.saimibauters.be/index.html'> hier </a> om terug te gaan!";
?>
EDIT: mail adres van webmaster veranderd, anders zullen email harvesters een vroege Sinterklaas hebben. Normale adres gebruiken in de code.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.