|
|
Joined: Jan 2000
Posts: 56
Member
|
Member
Joined: Jan 2000
Posts: 56 |
I am using the following code in my sign up sub to disallow a member from using a number in their name, along with other stuff.
if (($UserName =~ m/^s/) || ($UserName =~ m/ /) || ($UserName =~ m/s$/) || ($UserName =~ m/s{2,}/) || ($UserName =~ m/|!/) || ($UserName =~ m/||/) || ($UserName =~ m/|$/) || ($UserName =~ m/^|/) || ($UserName =~ m/"/) || ($Email =~ m/s/) || ($UserName =~ m/>|) || ($UserName =~ m/memberslist/) || ($UserName =~ m/emailfile/) || ($UserName =~ m/;/) || ($UserName !~ /^[A-Z-_]/) || ($UserName !~ /[a-zA-Z-_]$/)) {
and this works fine when a member signs up with say Rob123. But if he signs up as Rob123Rob then it goes through.
Any ideas on what to add to the above to not allow any number to be used in a member sign up?
Thanks, Parker
This message has been edited by Parker Clack on January 03, 2001 at 03:02 AM
|
|
|
|
Joined: Aug 2000
Posts: 335
Member
|
Member
Joined: Aug 2000
Posts: 335 |
Either add ($UserName =~ /d/) or add ($UserName =~ /[0-9]/). They're equivalent.
This message has been edited by Dave_L on January 03, 2001 at 05:19 AM
|
|
|
|
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
|
P.I.T.A. / Programmer
Joined: Sep 2000
Posts: 755 |
That is very bad and very unmaintainable. What DO you allow to go through? Once we have that, it may be easier to help you with a solution.
Do you only want to allow letters?
--mark
"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
|
|
|
|
Joined: Jan 2000
Posts: 56
Member
|
Member
Joined: Jan 2000
Posts: 56 |
Mark:
All I want to go through is alphanumerics and I want the first letter of the username to be capitalized.
Like I said what I have now works great at not allowing a number in a new registration unless the numbers are followed by an alphanumeric.
IE: Rob123 isn't allowed but Rob123Rob is allowed.
Parker
|
|
|
|
Joined: Jan 2000
Posts: 56
Member
|
Member
Joined: Jan 2000
Posts: 56 |
Dave:
That did the trick.
Thanks a lot,
Parker
|
|
|
|
Joined: Jan 2000
Posts: 56
Member
|
Member
Joined: Jan 2000
Posts: 56 |
One other thing that I need is if a member tries to sign up using all caps in their username that it would automatically convert it to lowercase.
Ie:
BOB WILLIAMS would be converted to Bob Williams.
Thanks, Parker
|
|
|
|
Joined: Aug 2000
Posts: 3,590
Moderator
|
Moderator
Joined: Aug 2000
Posts: 3,590 |
unless($username =~ /^[A-Z][A-Za-z0-9][A-Za-z]$/) ------------------  :: Who is Andy?
|
|
|
|
Joined: Feb 2000
Posts: 4,625
Member
|
Member
Joined: Feb 2000
Posts: 4,625 |
Beat me again andy. ------------------  Modification Developer of the Ultimate Bulletin Board Due to time limitation, I do not offer support Via. E-mail, ICQ or AIM. Regards, MasterMind
|
|
|
|
Joined: Jan 2000
Posts: 56
Member
|
Member
Joined: Jan 2000
Posts: 56 |
atom:
How would I put that line in the above if statement or whould I use this on a separate line?
Thanks, Parker
|
|
|
|
Joined: Jan 2000
Posts: 56
Member
|
Member
Joined: Jan 2000
Posts: 56 |
atom:
I figured out how to put this in the if statement above but when I put it in it won't allow me to sign up if I am using a lowercased name either.
So bob, BOB or Bob doesn't get passed through.
I want Bob to go through and bob to go through but not BOB.
Thanks again, Parker
|
|
|
Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.
Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
|
|
Posts: 69
Joined: January 2001
|
|
Forums63
Topics37,575
Posts293,931
Members13,824
|
Most Online6,139 Sep 21st, 2024
|
|
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
|
|
|
|
|