Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - CAPTCHA with Single ASP webpage
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Forum LockedCAPTCHA with Single ASP webpage

 Post Reply Post Reply Page  12>
Author
sdv86 View Drop Down
Newbie
Newbie


Joined: 31 July 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdv86 Quote  Post ReplyReply Direct Link To This Post Topic: CAPTCHA with Single ASP webpage
    Posted: 31 July 2007 at 4:42pm
Hi--I hope someone can help me...

Per basic integration I need to place:
<!-- include the Web Wiz CAPTCHA form element -->
<!--#include file="CAPTCHA/CAPTCHA_form_inc.asp" -->
where I wish the CAPTCHA image to be...

and

<!-- Include file for CAPTCHA form processing -->
<!-- #include file="CAPTCHA/CAPTCHA_process_form.asp" -->
where I wish the processing to take place for my webform.

Unfortunately I don't have two webpages.  I have a single ASP file which pulls data from a Microsoft Access database.  I have placed the top code near the submit form and thats set, but when I place the bottom code into the document header, I receive an error:

Microsoft VBScript compilation error '800a0411'

Name redefined

/CAPTCHA/CAPTCHA_license.asp, line 46

Const strLicense = ""
------^

The ASP file I am using is located here.  Any ideas?  Thank you!  http://asp101.com/samples/viewasp.asp?file=db_paged_search.asp
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 July 2007 at 6:51pm
Try place the code you submit to on a second page, otherwise because the files are including the same files you will get errors like this.
Back to Top
sdv86 View Drop Down
Newbie
Newbie


Joined: 31 July 2007
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote sdv86 Quote  Post ReplyReply Direct Link To This Post Posted: 01 August 2007 at 3:39am
Done, unfortunately it didn't work.  Same error.  Any other ideas?  Thank you!
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 August 2007 at 7:41am
Now go through the installation instructions again, you only include those files required for the page in question.
Back to Top
jrcarr View Drop Down
Newbie
Newbie
Avatar

Joined: 17 July 2008
Location: Arkansas, USA
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote jrcarr Quote  Post ReplyReply Direct Link To This Post Posted: 17 July 2008 at 9:33pm
Originally posted by WebWiz-Bruce WebWiz-Bruce wrote:

Try place the code you submit to on a second page, otherwise because the files are including the same files you will get errors like this.
 
I'm sorry, but I didn't seem to have much trouble getting this code to work on a single form/results page.   I write the majority of my code to all run within a single page, instead of having to have 2 pages for everything.  I work on site with 100 or more pages, it's real hard to track that, let alone twice that many.
 
Here is a very basic layout using a copy of example.asp page as example2.asp and changed the action="example2.asp" in the <form> so that there isn't a second page involved.   My page(s) that I am using it on are far more complicated that this example, so I know it will work on about any single page.  The one page I am testing it in uses SQL Connections, DataSets, Error checking on the rest of the Form input as well.
 
<%@LANGUAGE="VBSCRIPT" %>
<!-- Include file for CAPTCHA configuration -->
<!-- #include file="CAPTCHA/CAPTCHA_configuration.asp" -->
<!-- Include file for CAPTCHA form processing -->
<!-- #include file="CAPTCHA/CAPTCHA_process_form.asp" -->          
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Web Wiz CAPTCHA Demo</title>
<style type="text/css">
<!--
.title {font-family: Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; }
.header {font-family: Arial, Helvetica, sans-serif; font-size: 18px; font-weight: bold; }
.text {font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.small {font-size: 10px}
body { background-color: #CCCCCC; }
-->
</style>
</head>
<body>
<div style="text-align:center;" class="header"> Web Wiz CAPTCHA <br />
  <br />
</div>
<form action="example2.asp" method="post" name="form1" id="form1">
  <table width="300" border="0" style="text-align:center; background-color:#000000;" cellpadding="3" cellspacing="1">
    <tr>
      <td style="background-color:#FFFFFF;"><table width="100%" border="0" cellspacing="1" cellpadding="3">
          <tr>
            <td><span class="title">Demo Form</span></td>
          </tr>
          <tr>
            <td><span class="text">Name:</span>
              <input type="text" name="name" value="<%= Request.Form("name")%>" /></td>
          </tr>
          <tr>
            <td class="text"> Enter the code exactly as you see it in the image:-<br />
                <span class="small">(Cookies must be enabled)</span><br />
               
<!-- include the Web Wiz CAPTCHA form -->
<!--#include file="CAPTCHA/CAPTCHA_form_inc.asp" -->
           </td>
          </tr>
          <tr>
            <td align="center"><input name="Submit Form" type="submit" id="Submit Form" value="Submit" />
            </td>
          </tr>
        </table></td>
    </tr>
  </table>
</form>
<%
'If CAPTCHA is entered correctly run the following code
If Request("CAPTCHA_Postback") AND blnCAPTCHAcodeCorrect = True Then
       'Place code here that is to run if CAPTCHA is entered correctly
       Response.Write(request.Form("name")& ": The CAPTCHA code is correct")

'If CAPTCHA is NOT entered correctly run the following code
ElseIf Request("CAPTCHA_Postback") AND blnCAPTCHAcodeCorrect = False Then
       'Place code here that is to run if CAPTCHA is NOT entered correctly
       Response.Write(request.Form("name")& ": The CAPTCHA code is NOT correct")
End If
%>
</body>
</html>
 
Jack
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: 18 July 2008 at 7:55am
This is a very old post you are dragging up from almost a year ago.

Since this post version 4 of Web Wiz CAPTCHA has been released which does support submitting the contents back to the same page/file.
Back to Top
jrcarr View Drop Down
Newbie
Newbie
Avatar

Joined: 17 July 2008
Location: Arkansas, USA
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote jrcarr Quote  Post ReplyReply Direct Link To This Post Posted: 18 July 2008 at 5:58pm
Originally posted by WebWiz-Bruce WebWiz-Bruce wrote:

This is a very old post you are dragging up from almost a year ago.

Since this post version 4 of Web Wiz CAPTCHA has been released which does support submitting the contents back to the same page/file.
 
And this is very nice, but I hadn't found any where that this is stated.  I apologize.
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: 21 July 2008 at 8:48am
I've just had a look and you are correct.

Will need to make sure that this is more obvious with this new release.

Thanks for pointing this out.
Back to Top
 Post Reply Post Reply Page  12>

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.