Cannot get captcha to work
I have placed a captcha on this page: form2.php.
I cannot get it to work.
Thanks
I have placed a captcha on this page: form2.php.
I cannot get it to work.
Thanks
since your form posts to a pearl script, you will not be able to use captcha with this form. the problem is this:
when a form is submitted, the form data is sent directly to the page specified in the action attribute of the form. the action attribute of your form is to post directly to the formprocess3.pl page which is a pearl script.
<form id="inquiry" action="http://www.nantucketantiquesdepot.com/cgi-bin/formprocess3.pl" method="post" name="inquiry" enctype="application/x-www-form-urlencoded" onsubmit="return validator(this)">
you would need to add the server validation php code for validating the entered captcha value to the action page, however, you cant add php code to a pearl script.
the only other option would be to change the action of the form to post to itself, then use cURL to send the post to the pearl script using the following code after the validation code block, but this is not supported:
<?php
if (($_SERVER["REQUEST_METHOD"] == "POST")) {
$c = curl_init();
curl_setopt($c, CURLOPT_URL, "http://www.nantucketantiquesdepot.com/cgi-bin/formprocess3.pl");
curl_setopt($c, CURLOPT_TIMEOUT, 90);
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_POSTFIELDS, $_POST);
$result = curl_exec($c);
curl_close($c);
}
?>
OK, I tried a different method but the captcha is still failing to validate. I am a newbie to captcha but not to php. Thanks for your help.
index-captcha.php
the method of your form is still to post to another page:
<form action="../form_response.html" method="post" id="comments_form">
Rule #1 when working with forms:
All form Processing must occur on the forms action page. for captcha to work, the server validation needs to be added to the forms action page.
normally the work flow with server validation for form toolkit is to set the form to post to itself, use server validation to validate the captcha, and use Universal Email so send the email. in universal Email you can set the redirect to go to another page.
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.