...

View Full Version : Empty email on php contact formů



dhummelen
03-24-2009, 07:33 PM
I'm really having a hard time to make a simple php contact form work. I don't get anny fild in forms back in my email inbox and no sender. the email is just allmost empty an fild with blancs No text is send to my email;
Subject: Contact
Datum: 24 maart 2009 17:16:00 GMT+01:00
To: d.hommelen@gmail.com
From: (<<<here's sepose to be an email adress)


Naam:
Onderwerp:
Email:
Bericht:

Where are the fild in Fields that you fil in on the

<?php

$emailSubject = 'Contact';
$webMaster = 'd.hommelen@gmail.com';

$naamField = $_POST['naam'];
$onderwerpField = $_POST['onderwerp'];
$emailField = $_POST['email'];
$berichtField = $_POST['bericht'];

$body = <<<EOD
<br><hr><br>
Naam: $naam <br>
Onderwerp: $onderwerp <br>
Email: $email<br>
Bericht: $bericht <br>
EOD;

$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
$success = mail($webMaster, $emailSubject, $body, $headers);

$theResults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>lonneke ten hooven - koken op maat</title>
<link href="css/main.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="wrapper">
<div id="sidebar"> <a href="index.html"><img src="_media/logoKokenOpMaat.gif" width="345" height="110" alt="Logo Lonneke ten Hooven Koken op Maat" /></a><img src="_media/sidebarContact.jpg" width="345" height="600" alt="koken op locatie" />
</div>
<div id="header">
<ul>
<li><a href="koken_op_maat/koken_op_maat.html">koken op maat</a></li>
<li><a href="thema_menu/thema_menu.html">thema menus</a></li>
<li><a href="work_shops/work_shops.html">work shops</a></li>
<li><a href="patisserie/patisserie.html">patisserie</a></li>
</ul>
</div>
<div id="mainContent">
<h1>Contact</h1>
<p>&nbsp;</p>
<p>Bedank voor uw bericht.</p>
<p>&nbsp;</p>
</div>
<div id="footer">
<ul>
<li>Telefoon: +31 (0) 6 22 555877 <a href="mailto:info@lonnekekokenopmaat.nl">info@lonnekekokenopmaat.nl</a> <a href="contact.html">contact</a></li>
</ul>
</div>
</div>
</body>
</html>
EOD;
echo "$theResults";

?>

dhummelen
03-24-2009, 07:47 PM
http://dhummelen.terminalcare.net/test/contact.html is the live preview

rafiki
03-24-2009, 07:48 PM
Add Field to the end of your variables!

$naamField = $_POST['naam'];
$onderwerpField = $_POST['onderwerp'];
$emailField = $_POST['email'];
$berichtField = $_POST['bericht'];

$body = <<<EOD
<br><hr><br>
Naam: $naam <br>
Onderwerp: $onderwerp <br>
Email: $email<br>
Bericht: $bericht <br>

dhummelen
03-24-2009, 09:40 PM
I overlooked it. Thanks for pointing it out. Staring at a screen all day can make you blind.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum