#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    6
    Rep Power
    0
    I have an online community site built on PHP and MySQL. The users should register a screen name for themselves. The name must be 4-25 characters and contain ONLY alphanumeric characters and characters - and _. The name must start with a letter. The users shouldn't be able to register with a name that contains any other characters.

    I don't know what I'm missing, but I just don't seem to be able to build a complete solution for this using regular expressions. Someone, please help me!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 1999
    Posts
    114
    Rep Power
    16
    if (!ereg ("^[[:alpha:]][a-zA-Z0-9_-]{3,24}$", $sName)) {
       echo ("Invalid.");
    }

    // Untested!
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    6
    Rep Power
    0
    Thank you so much. As I expected, it was easier than I thought :-)

Similar Threads

  1. How to resize frame according to screen resolution???
    By skuba in forum HTML Programming
    Replies: 10
    Last Post: January 5th, 2004, 05:51 PM
  2. Some help with screen please
    By JosephB in forum Linux Help
    Replies: 1
    Last Post: November 1st, 2003, 12:00 PM
  3. Right justify new window regardless of screen resolution
    By UncleMole in forum HTML Programming
    Replies: 4
    Last Post: August 19th, 2003, 06:08 PM
  4. on the fly screen resolution detection
    By n0_cArR1eR in forum PHP Development
    Replies: 2
    Last Post: July 3rd, 2002, 07:31 PM
  5. Full screen video in a full screen site
    By SuperFlu in forum HTML Programming
    Replies: 1
    Last Post: February 20th, 2002, 05:37 PM

IMN logo majestic logo threadwatch logo seochat tools logo