I have a PHP post problem with a textarea. I've searched this site, and the suggested remedies involved pulling the textarea's ID, and making sure you are using htmlspecialchars. I'm doing both, and I still can't figure out why it won't post the contents of my textarea.
HTML
PHP
$realName = $name = $theMessage = $subject = $WHATmessage = "";
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$realName = test_input($_POST["name"]);
$name = test_input($_POST["email"]);
$theMessage = test_input($_POST["theTextArea"]);
}
function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
return $data;
}
$subject = 'SUPERGROUP Inquiry - ' . $realName . ' - [' .date("F j, Y, g:i a").']';
$WHATmessage = $realName . ' is looking forward to hearing from us!'.PHP_EOL.'Their email is: '. $name .'!'.PHP_EOL.'They said: "'.$theMessage.'"';
mail('hello@sprgrp.com', $subject, $WHATmessage );