|
|||
|
Here's a simple way to add CAPTCHA functionality to your ADDT forms.
* Download the ASP CAPTCHA security image generator (captcha.asp) from www.tipstricks.org and upload it to your server. * Start the custom form wizard, add all the needed fields plus a text field for the user's security character input. For convenience let's name that field "txtCAPTCHA". You can make the txtCAPTCHA field required but it's not necessary. * Add the security image to your form which is just an image with its source pointing to the CAPTCHA script you downloaded in step 1. If you uploaded the script to your includes folder then the code for the image would be similar to: <img src="includes/captcha.asp">. * Add a BEFORE trigger and enter the following code: Dim txtCAPTCHA Dim sesCAPTCHA txtCAPTCHA = tNG.getColumnValue("txtCAPTCHA") sesCAPTCHA = Trim(Session("CAPTCHA")) If Cstr(txtCAPTCHA) <> Cstr(sesCAPTCHA) OR Len(sesCAPTCHA) < 1 Then Set check_failure = new tNG_error 'check_failure.init "Check security code!", Array(), Array() check_failure.setFieldError "txtCAPTCHA", "Incorrect security code", array() Set Trigger_Custom1 = check_failure Else Set Trigger_Custom1 = nothing End If * Add a custom AFTER trigger and enter the following code: Session("CAPTCHA") = vbNullString That's it! Enjoy. |
| Sponsored Links |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise