Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - CAPTCHA and Option Explicit
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedCAPTCHA and Option Explicit

 Post Reply Post Reply
Author
Tomcat View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomcat Quote  Post ReplyReply Direct Link To This Post Topic: CAPTCHA and Option Explicit
    Posted: 30 October 2006 at 8:54pm
I have installed the CAPTHCA files and the application works up to the time that the form variables are sent to CDONTS mail to be processed in my file:  http://www.volz.org/hauntedhouse/emailForm.asp  This form uses Option Explicit
 
 
I have declared the variables in the email form body as follows:
 
'This is the CAPTCHA Code entered on the form
 Dim securityCode = strCAPTCHAenteredCode
 
But something is still amiss.  I get the error:
 

Microsoft VBScript compilation error '800a0400'

Expected statement

/hauntedhouse/emailForm.asp, line 4

Option Explicit
Are there other variables that I am missing?  I would
appreciate any help you can provide so that I can get the
application working properly.  Thanks.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2006 at 9:19am
You would need to use:-


Dim securityCode

securityCode = strCAPTCHAenteredCode


Back to Top
Tomcat View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomcat Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2006 at 2:24pm
Unfortunately, I still get the same error:
 
 

Microsoft VBScript compilation error '800a0400'

Expected statement

/hauntedhouse/emailForm.asp, line 4

Option Explicit
^
It doesn't matter whether I place the code at the top of the file
or within the body.
What am I missing.  Should the variable be declared somewhere else?
Perhaps in the include file CAPTCHA_form_inc.asp?
Any help is greatly appreciated.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 31 October 2006 at 2:27pm
The simplest option is to remove the line option explicit 
Back to Top
Tomcat View Drop Down
Newbie
Newbie


Joined: 30 October 2006
Location: United States
Status: Offline
Points: 7
Post Options Post Options   Thanks (0) Thanks(0)   Quote Tomcat Quote  Post ReplyReply Direct Link To This Post Posted: 01 November 2006 at 5:01pm
I removed the Option Explicit statement and the errors did go away.
But in further troubleshooting this application, I noted that the form submits even though nothing is filled out in the CAPTCHA field.
 
 
Since the form was uploaded to the server, the email address for the form results has been clobbered by SPAM.
 
The installation of the application is going a lot rougher than I expected.
 
Shouldn't the ASP script test the CAPTCHA field for an unfilled field?  Or does there need to be an additional condition to test if the field is blank?
 
Also, the form results are sent where or not the CAPTCHA Code is correct or incorrect.  Where should the additional conditions be written?  It was my understanding that the ASP files supplied with the application do not need modification.
 
Any help you can provide is greatly appreciated.
Back to Top
WebWiz-Bruce View Drop Down
Admin Group
Admin Group
Avatar
Web Wiz Developer

Joined: 03 September 2001
Location: Bournemouth
Status: Offline
Points: 9844
Post Options Post Options   Thanks (0) Thanks(0)   Quote WebWiz-Bruce Quote  Post ReplyReply Direct Link To This Post Posted: 01 November 2006 at 6:32pm
The files supplied are only for demonstration.

You need to put in what happens if the CAPTCHA code is entered incorrectly.

If you have setup the CAPTCHA correctly then when you submit the form it will test to see if the CAPTCHA image has been entered correct, if the CAPTCHA image is correct the varaiable 'blnCAPTCHAcodeCorrect' is set to true.

So you need to write a condition into your software something like:-

If blnCAPTCHAcodeCorrect =  True Then
   
    Run code to send email

ElseIf blnCAPTCHAcodeCorrect = False Then

    Inform user the CAPTCHA code it wrong

End If


As the Web Wiz CAPTCHA is a generic application that could be used for lots of different things it's not possiable to supply it pre-done so to speak, so instead the variable 'blnCAPTCHAcodeCorrect' is set to true or false, you then need to write the code yourself as to what to or not do if the CAPTCHA image is not correct.


Edited by -boRg- - 01 November 2006 at 6:33pm
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.