form to email php code help

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
camaross
Forum Newbie
Posts: 1
Joined: Thu Oct 28, 2010 8:42 am

form to email php code help

Post by camaross »

I am trying to create a php code to send info from my html form to an email address, so below is my code:

$name = $_POST['name'];
$body = "This is an email from: $name";

$success = mail($webMaster, $emailSubject, $body, $headers);

I can receive the email, but all I got in the email body is "This is an email from:". I can not get anything related to what I input as $name. I am pretty sure the value name in my html is 'name'.

Anyone could help?

Thank you.
klevis miho
Forum Contributor
Posts: 413
Joined: Wed Oct 29, 2008 2:59 pm
Location: Albania
Contact:

Re: form to email php code help

Post by klevis miho »

Are you really sure that the name="name" in the input tag?
Post Reply