Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder
    Join Date
    Aug 2005
    Posts
    257
    Thanks
    8
    Thanked 0 Times in 0 Posts

    check this please

    I make a comparition.

    if user_name is equal to "idiot" It's can't be register. My code:

    PHP Code:
    if (strlen($_REQUEST['user_name']) == "idiot") {
    echo 
    "This username can't be register, choose other";
    } else {
    echo 
    "Congratulation!";

    Is my code right? Regards

  • #2
    Regular Coder
    Join Date
    May 2006
    Location
    Wales
    Posts
    820
    Thanks
    1
    Thanked 82 Times in 79 Posts
    Your using strlen on the username, this returns the length of the username (eg if it was idiot it would return 5). Remove that and it should work fine.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •