PDA

View Full Version : How do I CAPTCHA existing forms?



Webbiz
21-Jan-2011, 10:56 PM
I have a couple of forms that are getting beaten up by BOTS. Deleting their spam submissions each day has finally driven me to do something about it.

Uploaded onto my server are the two files, verifyimg.php and verifytest.php.

These have been tested and work fine.

Next, I have added the recommended code onto one of my forms that displays the image and also a text box with the name "imgverify".

The instructions then state that I should configure REQUIRE_CAPCHA in my formmail.php file. This file, BTW, has been upgraded to v8.24.

Where are the instructions for using REQUIRE_CAPCHA? I clicked on the link and it simply says to "Set REQUIRE_CAPTCHA to a non-empty string to ensure that CAPTCHA is required for all form submissions."

The example provided is:

"$REQUIRE_CAPTCHA = "Please enter the image characters";"

Huh?

Do I enter exactly what is shown above, or ???.

The instructions leave me scratching my head.

Can someone please direct me further on this?

Thanks.

Webbiz

tones.ie
22-Jan-2011, 01:01 AM
Hi,

I too have just added the captcha to excisting forms to help cut down on spammers....

"$REQUIRE_CAPTCHA = "Please enter the image characters";"

entering text into this string enables the captcha ...what ever you enter here gets displayed in an error message when the letters are not enterd correctly...so you can have it say what ever you want it to say.

If you enter the wrong letters mine says this

An error occurred while processing the form .


The form required some values that you did not seem to provide.
Please enter the image characters. Use the browsers back button to return to the form.

Im in the process of making that a litlle bit fancier but have just got the forms to work as i want...well almost...just cant get the image reload to work in fiefox *sigh
Hope that helps.....

Webbiz
22-Jan-2011, 02:25 AM
That was what confused me.

I thought "Please enter the image characters";" were instructions for me to enter the characters, and I could not figure out how I was suppose to know what those characters were to hard code them in the script.

Thanks for clearing this up for me. Now I know that this is the instruction that is provided when an ERROR occurs for not entering characters correctly.

It's working now, though it is sure ugly. Also, using the BACK is not enough. You have to also REFRESH the page. For now, I've stated this in the error message. But there should be a more elegant way to do this.

Thanks again for your help. :)

tones.ie
22-Jan-2011, 02:30 AM
Hi...have a look at " fmbadhandler.php" here


http://www.tectite.com/fmhowto/adverror.php

This is my next project to get the error page nicer and get the user back to the form.....

Webbiz
22-Jan-2011, 03:15 AM
Thanks again.

That page customization worked perfectly.

I have created a customer ERROR PAGE with my logo, and it provides a return link automatically to the form retaining the original values.

Works great!

:)

russellr
23-Jan-2011, 07:56 PM
Hi,



Im in the process of making that a litlle bit fancier but have just got the forms to work as i want...well almost...just cant get the image reload to work in fiefox *sigh
Hope that helps.....

This sample has JavaScript code that work in Firefox and IE:
http://www.tectite.com/public_downloads/sampleimgverify.zip

russellr
23-Jan-2011, 07:59 PM
Hi,



Where are the instructions for using REQUIRE_CAPCHA? I clicked on the link and it simply says to "Set REQUIRE_CAPTCHA to a non-empty string to ensure that CAPTCHA is required for all form submissions."

The example provided is:

"$REQUIRE_CAPTCHA = "Please enter the image characters";"

Huh?

Do I enter exactly what is shown above, or ???.

The instructions leave me scratching my head.

Can someone please direct me further on this?


That page (http://www.tectite.com/fmdoc/require_captcha.php) also says:
To enforce CAPTCHA, you set REQUIRE_CAPTCHA to a string that will be displayed to the user if they don't provide the "imgverify" field.
I'm not sure how much clearer the instructions can be.

Perhaps you can suggest some wording that will be easier for everyone to understand?

tones.ie
23-Jan-2011, 10:49 PM
Thanks russellr,

i was missing the id="vimg" in my code !! was able to get it going with the help of "crabtree"