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:
$errors = '';
$myemail = 'firstname.lastname@example.org';//<-----Put Your email address here.
$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 \
$headers = "From: $myemail";
$headers .= "Reply-To: $p_email";
//redirect to the 'thank you' page
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'];
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
Uncomment it and you should find it works.