Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jan 2000
Posts: 56
Member
Member
Offline
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/>|

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

Sponsored Links
Joined: Aug 2000
Posts: 335
Member
Member
Offline
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
Offline
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
Offline
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
Offline
Joined: Jan 2000
Posts: 56
Dave:

That did the trick.

Thanks a lot,

Parker

Sponsored Links
Joined: Jan 2000
Posts: 56
Member
Member
Offline
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
Offline
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
Offline
Joined: Feb 2000
Posts: 4,625
Quote
quote:
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
Offline
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
Offline
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

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

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.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
isaac
isaac
California
Posts: 1,157
Joined: July 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20240430)