Help getting textarea to work with contact form

I have a contact form that when hit submits it goes to my email. I’ve gotten every input to come across email except for the textarea box?

Here is my PHP:

<?php 

$errors = '';
$myemail = 'baderup99@aol.com';//<-----Put Your email address here.


if( empty($errors))
{
	$to = $myemail; 
	$email_subject = "Registration submission from FacetoFaceTutoring: $name";
	$email_body = "You have received a new registration. ".
	" Here are the details:\
 Name of Parent: $p_fname $p_lname \
 Email of Parent: $p_email \
 Name of Student: $s_fname  $s_lname \
 Email of Student: $s_email \
 Year: $year \
 Subject: \
 $subject"; 
	
	$headers = "From: $myemail"; 
	$headers .= "Reply-To: $p_email";
	
	mail($to,$email_subject,$email_body,$headers);
	//redirect to the 'thank you' page
	header('Location: contact-form-thank-you.html');
} 
?>

Here is my HTML for the text area:

<label for="subject" class="fixed">Subject(s) student<br/> needs help in:<span class="red">*</span></label>
		<textarea class="subject_text" cols="25" rows="5" id="subject" name="subject"></textarea>

What am I doing wrong?

Are you using anything like:

$Subject = $_POST[‘subject’];

Anywhere?

You know I don’t know too much about PHP, Im more of a HTM/CSS guy.

But I do have those $Subject = $_POST[‘subject’]; in my form, but at the moment they are commented out because I wasn’t exactly sure what they do.

However, everything else is working, when I hit submit I have a bunch of inputs that translate into an email, yet textarea is the only one that doesn’t come through.

When looking at this: $Subject = $_POST[‘subject’]; what part of the HTML is it relating to? the name attribute?

Yes, the name attribute is added to the _POST array with the key of whatever the name attribute is. So $_POST[‘subject’] grabs your textarea contents.

If it was a script you’ve used from elsewhere (EG downloaded) and it was written to do what you’re asking there is no need to start commenting out bits just because you don’t understand them. Someone else did and thats why they are there :wink:

Uncomment it and you should find it works.