Peceiver;10983053 wrote:
$recaptcha_challenge_field = $_POST["recaptcha_challenge_field"];
$recaptcha_response_field = $_POST["recaptcha_response_field"];
echo $recaptcha_challenge_field;
echo $recaptcha_response_field;
so according to this.. they are not getting posted.
According to what...? There is no output? You get an E_NOTICE about undefined index?
printf('<pre>%s</pre>', print_r($POST,1)); will show you everything contained in $POST.
Anyway, looking at your last posted code, there is no challenge field, just a response field. And if that's just a copy-paste error, perhaps the problem is using htmlspecialchars on recaptcha challenge and response data? I've no idea how that function works, so I can't say for sure, but it's a possibility.
And some other things I recommend you fix
# Why htmlspecialchars?
$fromemail = htmlspecialchars($_POST['fromemail']);
$fname = htmlspecialchars($_POST['fname']);
$lname = htmlspecialchars($_POST['lname']);
$message = htmlspecialchars($_POST['message']);
/* Email address input: John Doe<john@example.com>
* Email address output: John Doe<john@example.com>
* Subject input: Please read & reply asap
* Subject output: Please read & reply asap
*/
# Since you removed the if statement, this now does absolutely nothing
!isset($fromemail) || empty($fromemail) ||
!isset($fname) || empty($fname) ||
!isset($lname) || empty($lname) ||
!isset($message);
//CREATE safe text
# Safe how?
$fromemail = stripslashes($fromemail);
$fname = stripslashes($fname);
$lname= stripslashes($lname);
$message = stripslashes($message);
/* message input:
* You should find the folder under C:\users\accountname\
* message output
* You should find the folder under C:usersaccountname
*/
// CREATE safe text
# Safe how?
$fromemail = trim($fromemail);
$fname = trim($fname);
$lname= trim($lname);
$message = trim($message);
/* message input:
Hi
That's all!
* message output:
Hi
That's all
* using trim on names and email address is ok, but if the user wants to start his
* message with one or more whitespaces, why not let him?
*/
# Once again, why the htmlspecialchars?
$recaptcha_challenge_field = htmlspecialchars($_POST["recaptcha_challenge_field"]);
$recaptcha_response_field = htmlspecialchars($_POST["recaptcha_response_field"]);
# linebreak?
e
cho $recaptcha_challenge_field;
echo $recaptcha_response_field;