When using heredoc, you must open and close the variable with the same identifier.
$body = <<<em
<hr>
name: $name
surname: $surname
email: $email
telephone: $telephone
comments: $comments
EOD;
should be:
$body = <<<EOD
<hr>
name: $name
surname: $surname
email: $email
telephone: $telephone
comments: $comments
EOD;
Also, variables in php are case sensitive, so you'll have a blank page unless you change echo "$theresults"; to echo "$theResults";
buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
Next time, wrap your code in code tags when posting to keep things neat. There are plenty of people here to help out. Keeping things neat will improve your chances of getting help.
buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
Wrap the code like so:
[code=php]Code goes here[/code]
As to your problem, your email contains undefined variables. For instance you define namefield as $nameField = $_POST['name']; but in the email you send, you have the undefined variable $name instead of the defined $nameField.
buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
The name the element has in the form goes inside the brackets.
So if your form has
<input name="name" type="text" id="name" tabindex="16" />
After the form is submitted, PHP can assign the value posted to the variable. Here we assign the value of the textbox above to the variable $nameField:
$nameField=$_POST['name'];
Now if you want to use that variable in your email, you'll need to use the variable just defined.
$body = <<<EOD
<hr>
name: $nameField
Get it??
buddylee17
Practically a Master Poster
697 posts since Nov 2007
Reputation Points: 232
Solved Threads: 137
My Friend as far as i am concerned you are a god in the PHP world
i can not say thank you enough
Cheers
Adam
You can thank to buddylee17, just click on "Add to buddylee17 reputation" in the post that deserves it. There you can also leave short message with your thanks which other member can see and of course mark thread as solved (which you already did)
peter_budo
Code tags enforcer
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902