hole in script - please help

Discussion in 'PHP' started by billybrag, May 15, 2006.

  1. #1
    Hello all,

    just found a major problem with one of my scripts.

    I need to stop people from entering usernames that are more than one word.

    ie

    Johnsmith - good
    john smith - bad

    i need to add some kind of form validation to stop this.

    any ideas?
     
    billybrag, May 15, 2006 IP
  2. mad4

    mad4 Peon

    Messages:
    6,986
    Likes Received:
    493
    Best Answers:
    0
    Trophy Points:
    0
    #2
    mad4, May 15, 2006 IP
  3. tech86

    tech86 Peon

    Messages:
    83
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #3
    $newuser = strreplace(" ", "", $username);

    echo "your username is $newuser";
     
    tech86, May 15, 2006 IP
  4. billybrag

    billybrag Peon

    Messages:
    324
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    i do some validation with js too - what would the code for that be?
     
    billybrag, May 15, 2006 IP