close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Cannot get captcha to work

Thread began 4/05/2012 7:42 am by mouse426912 | Last modified 4/10/2012 8:12 am by mouse426912 | 1580 views | 4 replies |

mouse426912

Cannot get captcha to work

I have placed a captcha on this page: form2.php.
I cannot get it to work.

Thanks

Sign in to reply to this post

Jason ByrnesWebAssist

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:
<?php

if (($_SERVER["REQUEST_METHOD"] == "POST"))     {
$c curl_init();
curl_setopt($cCURLOPT_URL"http://www.nantucketantiquesdepot.com/cgi-bin/formprocess3.pl");
curl_setopt($cCURLOPT_TIMEOUT90);
curl_setopt($cCURLOPT_POST1);
curl_setopt($cCURLOPT_SSL_VERIFYPEER0);
curl_setopt($cCURLOPT_RETURNTRANSFER1);
curl_setopt($cCURLOPT_POSTFIELDS$_POST);
$result curl_exec($c);
curl_close($c);

}
?>
Sign in to reply to this post

mouse426912

Built a php form - still not working

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

Sign in to reply to this post

Jason ByrnesWebAssist

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.

Sign in to reply to this post

mouse426912

Problem Solved

Thanks - that did the trick

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...