Author |
Topic |
|
vweyes
New Member
74 Posts |
Posted - 28 July 2002 : 12:47:05
|
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
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 28 July 2002 : 13:09:27
|
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 |
|
|
Hamlin
Advanced Member
United Kingdom
2386 Posts |
Posted - 28 July 2002 : 13:13:39
|
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 |
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 28 July 2002 : 13:16:58
|
I find that giving Line Numbers are useless, especially because there are so many variations of everyones source code.
http://www.nineinchnailz.com |
|
|
Hamlin
Advanced Member
United Kingdom
2386 Posts |
Posted - 28 July 2002 : 13:18:39
|
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 ™ |
|
|
vweyes
New Member
74 Posts |
Posted - 28 July 2002 : 15:57:05
|
thanks for the help!
|
|
|
dayve
Forum Moderator
USA
5820 Posts |
Posted - 28 July 2002 : 17:08:59
|
quote:
thanks for the help!
always a pleasure to assist at the greatest ASP/Forum Community on the Internet
http://www.nineinchnailz.com |
|
|
|
Topic |
|