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

 All Forums
 Snitz Forums 2000 MOD-Group
 MOD Add-On Forum (W/O Code)
 a way I can limit the length of usernames
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

vweyes
New Member

74 Posts

Posted - 28 July 2002 :  12:47:05  Show Profile
Does anyone know any code where I can limit the lenth of usernames? I'm guessing I'll have to edit register.asp but what do I add?

I'm not very good with .asp

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 28 July 2002 :  12:51:40  Show Profile
Just add something like this with the other error messages

if Len(Request.Form("Name")) > 10 then
Err_Msg = Err_Msg & "User name too long, or some other message"
end if



You can change the 10 to whatever the max length is you want, and it would go in register.asp yes.

Or just set a max size value for the input box, that would be easier


No matter how fast light travels it finds the darkness has always got there first, and is waiting for it.
http://www.ian-hamlin.co.uk


Edited by - Hamlin on 28 July 2002 12:53:55
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 July 2002 :  13:09:27  Show Profile  Visit dayve's Homepage
Hamlin is right, but to give you more of a lead, you'll want to put this check after this line in your register.asp and then place the code after the very first else statement


if Request.QueryString("mode") <> "DoIt" then

.
.
.

else


if Len(Request.Form("Name")) > 10 then
Err_Msg = Err_Msg & "User name too long, or some other message"
end if



http://www.nineinchnailz.com


Edited by - dayve on 28 July 2002 13:13:01
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 28 July 2002 :  13:13:39  Show Profile
I was gonna give a line number, but forgot dayve

any way if you edit the inc_profile.asp file line 182


<INPUT maxlength="10" name="Name" size="25" value="<% =ChkString(rs("M_NAME"), "display") %>">


Add the red bit, that shold do the same thing....but with out the need for another asp check.


No matter how fast light travels it finds the darkness has always got there first, and is waiting for it.
http://www.ian-hamlin.co.uk


Edited by - Hamlin on 28 July 2002 13:14:38
Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 July 2002 :  13:16:58  Show Profile  Visit dayve's Homepage
I find that giving Line Numbers are useless, especially because there are so many variations of everyones source code.


http://www.nineinchnailz.com
Go to Top of Page

Hamlin
Advanced Member

United Kingdom
2386 Posts

Posted - 28 July 2002 :  13:18:39  Show Profile
quote:

I find that giving Line Numbers are useless, especially because there are so many variations of everyones source code.


http://www.nineinchnailz.com




True but at least they have an area to look, but giving code makes it clearer I suppose.


No matter how fast light travels it finds the darkness has always got there first, and is waiting for it.
http://www.ian-hamlin.co.uk
Go to Top of Page

vweyes
New Member

74 Posts

Posted - 28 July 2002 :  15:57:05  Show Profile
thanks for the help!

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 28 July 2002 :  17:08:59  Show Profile  Visit dayve's Homepage
quote:

thanks for the help!





always a pleasure to assist at the greatest ASP/Forum Community on the Internet


http://www.nineinchnailz.com
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.25 seconds. Powered By: Snitz Forums 2000 Version 3.4.07