phpmailer and recaptcha
hi
iv got phpmailer and recaptcha together but im stuck. iv integrated recaptcha within my php form and im stuck on this part where it validates recaptcha and then if success i want it to submit the form to phpmailer, but the code i thought would work doesnt... please see the following code // redirect to success page if ($success){ header( \'Location: ../Scripts/_lib/phpmailer-fe.php\'); } else{ print \"<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">\"; }
3 Answers
from testing i have managed to try this
if ($validationOK){ if (isset($_POST['submit'])) { include '../Scripts/_lib/phpmailer-fe.php'; } else{ header ("Location: error.html"); } }but this results in the recaptcha's iframe showing an error for my phpmailer so i need to somehow get include '../Scripts/_lib/phpmailer-fe.php';to include it in the parent window and not the recaptcha iframe. Posted: DonaldS 0 of 0 people found this answer helpful. Did you? Yes No you should add the if(isset($_POST['submit'])) before if ($validationOK)
You are quoting your string in a wrong way. Encapsulate it in single quotes:
print \'<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">\'; You should be able to find such errors with any editor that provides decent syntax highlighting (it can even be seen with the syntax highlighter in your question). If this is the problem, I don\'t know, you don\'t give enough information. Also note that according to Wikipedia, this method is deprecated. I don\'t know whether this solves the problem, you don\'t give enough information. Also if you are using HTTP 1.1, the URL provided to Location must be absolute: Note: HTTP/1.1 requires an absolute URI as argument to » Location: including the scheme, hostname and absolute path, but some clients accept relative URIs. You can usually use $_SERVER[\'HTTP_HOST\'], $_SERVER[\'PHP_SELF\'] and dirname() to make an absolute URI from a relative one yourself. Posted: MacOS 0 of 1 people found this answer helpful. Did you? Yes No the error.html link is incase someone misses out a field.
what im trying to do is get the form to send the values to phpmailer-fe.php but only after it verifies recaptcha.
but recaptcha in php is a self submitting form. really you can use any other captcha and try...
its not working : Any errors? What is it doing? What should it do?
can you give me the $success value i mean just show me more cods Posted: is_set 0 of 1 people found this answer helpful. Did you? Yes No the form went to that file. there are config files for that php file which allow you to set which fields are required. but to run recaptcha it runs in a self submitting form. so i need to actions in 1 form but in the recaptcha form there is that part of code i posted in my first post which states if success then you are redirected to whatever page you like. But i need to submit the form to the ../Scripts/_lib/phpmailer-fe.php file adding the php code at the Beginning of the page is prefered |
© Advanced Web Core. All rights reserved