| | |
VB Syntax error appears in one page but not the other?
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Apr 2007
Posts: 15
Reputation:
Solved Threads: 0
So Ive been working really hard to get a working ASP captcha to incorporate into my form (note, classic ASP not .net).
I FINALLY got it working in a test area, the form looks like this:
it works great, but as soon as I move it over to the page I need it to and incorporate that form into it, I get a VB error. The error says:
Microsoft VBScript compilation error '800a03ea'
Syntax error
/RoHSCompliant2.asp, line 174
Function captcha(captchaLength)
^
so i know where the error is but not how to remedy it. why would it be doing this? what code in the rest of the page could pull such an error?
THANKS!
I FINALLY got it working in a test area, the form looks like this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
<form action="<%=Request.ServerVariables("SCRIPT_NAME")%>" method="post"> <table border="0" width="570" align="center" cellpadding="1" cellspacing="0"> <tr> <td align="right" valign="center"><%=font4%><font color="#ff0000">* </font>First Name: </td> <td align="left" valign="top"><input name="first" size="25" maxlength="50" tabindex="1"></td> </tr> <tr> <td align="right"><%=font4%><font color="#ff0000">* </font>Last Name: </font></td> <td align="left"><input name="last" size="25" maxlength="50" tabindex="2"></td> </tr> <tr> <td align="right"><%=font4%>Company Name: </font></td> <td align="left"><input name="company" size="25" maxlength="100" tabindex="3"></td> </tr> <tr> <td align="right"><%=font4%><font color="#ff0000">* </font>E-Mail Address: </font></td> <td align="left"><input name="email" size="25" maxlength="100" tabindex="4"></td> </tr> <tr> <td align="right"><%=font4%> Phone: </font></td> <td align="left"><input name="phone" size="25" maxlength="20" tabindex="5"></td> </tr> <tr> <td align="right"><%=font4%> Part# 1: </font></td> <td align="left"><input name="partno1" size="25" maxlength="50" tabindex="6"></td> </tr> <tr> <td align="right"><%=font4%> Part# 2: </font></td> <td align="left"><input name="partno2" size="25" maxlength="50" tabindex="7"></td> </tr> <tr> <td align="right"><%=font4%> Part# 3: </font></td> <td align="left"><input name="partno3" size="25" maxlength="50" tabindex="8"></td> </tr> <tr> <td align="right"><%=font4%> Part# 4: </font></td> <td align="left"><input name="partno4" size="25" maxlength="50" tabindex="9"></td> </tr> <tr> <td align="right" valign="top"><%=font4%><font color="#ff0000">* </font>Comments: </td> <td align="left"><textarea name="message" rows="8" wrap="virtual" cols="20" tabindex="10"></textarea></td> </tr> <tr> <td align="right" valign="top"> </td> <td align="left"> <% 'Specify your captcha length here captchaLength = 5 Function captcha(captchaLength) if captchaLength > 15 then captchaLength = 15 HighestValue = left(100000000000000,captchaLength) lowestValue = left(999999999999999,captchaLength) Randomize intHighestNumber = Int((HighestValue - LowestValue + 1) * Rnd) + LowestValue session("captcha") = Int(intHighestNumber) x = 1 response.write vbcrlf & "<table width = ''>" & vbcrlf & vbtab & "<tr>" & vbcrlf while x <= captchaLength response.write vbtab & vbtab & "<td align = 'center'><img src = 'captcha.asp?captchaID=" & x & "' ></td>" & vbcrlf x = x + 1 wend response.write vbtab & "</tr>" & vbcrlf & "</table>" & vbcrlf End Function %> <% if request("action") = "captcha" then if cstr(request("captcha")) = cstr(session("captcha")) then response.write "Correct!" else response.write "Sorry, no match." end if end if %> Enter Code: <input name="captcha"> <BR /> <input type="submit" name="submit" src="images/b_submit.gif" border="0" tabindex="13" id="image1" value="Submit"></td> </tr> </table> </form>
it works great, but as soon as I move it over to the page I need it to and incorporate that form into it, I get a VB error. The error says:
Microsoft VBScript compilation error '800a03ea'
Syntax error
/RoHSCompliant2.asp, line 174
Function captcha(captchaLength)
^
so i know where the error is but not how to remedy it. why would it be doing this? what code in the rest of the page could pull such an error?
THANKS!
![]() |
Similar Threads
- System.Data.Sqlclient.Sqlexception: Line1 incorrect syntax at ']'. (ASP.NET)
- Tutorial: An introduction to Test Driven Development (Computer Science)
- 2 questions involving scripts, select tag, and loading pages (PHP)
- memory management in wndows 2000 (Windows NT / 2000 / XP)
- probelm with autogenerated mysql query (PHP)
- problem with autogenerated mysql query (MySQL)
- I just can't get this Javascript (JavaScript / DHTML / AJAX)
- IE Syntax Error and Can“t browse some sites (Viruses, Spyware and other Nasties)
- Invision Power Board mysql error when trying to view newly created forums (PHP)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: about registry key . . .
- Next Thread: how to resize the coordinates of the picture
| Thread Tools | Search this Thread |
Tag cloud for Visual Basic 4 / 5 / 6
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





