Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Current Version (Old)
 Field lengths not validated
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

ROB
Junior Member

USA
347 Posts

Posted - 29 November 2001 :  17:52:13  Show Profile  Visit ROB's Homepage  Send ROB an AOL message  Send ROB an ICQ Message  Send ROB a Yahoo! Message
There seems to be many places where field lengths are not constrained nor validated. For example, if I try to register right here at forum.snitz.com, and enter a long homepage url (>50 characters; I tried http://www.bigblueball.com/forums/topic.asp?TOPIC_ID=141&whichpage=2)it generates a SQL error when processing the form.

How can I prevent someone from entering more characters then are allowed in the database?

Jeff Hester
http://www.bigblueball.com
Absolutely everything about Instant Messaging & Chat

RichardKinser
Snitz Forums Admin

USA
16655 Posts

Posted - 29 November 2001 :  19:37:46  Show Profile
there is 2 ways you can do this.

in inc_profile.asp you can change this line:

						<td bgColor=<% =strPopUpTableColor %>><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><INPUT name="Homepage" size="25" value="<% if ChkString(RS("M_Homepage"), "display") <> " " and lcase(RS("M_Homepage")) <> "http://" then Response.Write(RS("M_Homepage")) else Response.Write("http://") %>"></font></td>


to this:

						<td bgColor=<% =strPopUpTableColor %>><font face="<% =strDefaultFontFace %>" size="<% =strDefaultFontSize %>"><INPUT name="Homepage" size="25" maxlength="50" value="<% if ChkString(RS("M_Homepage"), "display") <> " " and lcase(RS("M_Homepage")) <> "http://" then Response.Write(RS("M_Homepage")) else Response.Write("http://") %>"></font></td>



or, in register.asp add this:

	if Len(Request.Form("Homepage")) > 50 then
Err_Msg = Err_Msg & "<li>The Homepage URL can not be greater than 50 characters.</li>"
end if
Go to Top of Page

ROB
Junior Member

USA
347 Posts

Posted - 05 December 2001 :  19:32:34  Show Profile  Visit ROB's Homepage  Send ROB an AOL message  Send ROB an ICQ Message  Send ROB a Yahoo! Message
Belated thanks, Richard. I wonder why the forms don't do field-length validation "out-of-the-box?" Seems like a pretty routine requirement (and easily broken with long URLs!).


Jeff Hester
http://www.bigblueball.com
Absolutely everything about Instant Messaging & Chat
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.33 seconds. Powered By: Snitz Forums 2000 Version 3.4.07