Check user

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Check user

    Hi,
    Could one of you guys help me fix my code to check if username exsists,
    here is what i got
    Code:
    //does username exist?
    $check_user="select username from". $db ."where username=".$username;
    if($check_user===$username)
    {
    Echo "already taken!";
    }
    Else
    {
    echo "done!";
    }
    Visit my site

    #2
    Code:
    //does username exist?
    $check = mysql_fetch_array(mysql_query("SELECT username FROM ". $db ." WHERE username='$username' "));
    if($check[0]=="$username")
    {
    Echo "already taken!";
    }
    Else
    {
    echo "done!";
    }
    Last edited by subzero; 04.12.09, 22:19.
    Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
    Visit: WapMasterz Coming Back Soon!
    _______
    SCRIPTS FOR SALE BY SUBZERO
    Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
    FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
    _______
    Info & Tips
    php.net
    w3schools.com

    Comment


      #3
      You the man Sub ;)
      Visit my site

      Comment


        #4
        i forgot edit one pice userid to username or copy that code again.

        Let me know how it workin for you.
        Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
        Visit: WapMasterz Coming Back Soon!
        _______
        SCRIPTS FOR SALE BY SUBZERO
        Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
        FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
        _______
        Info & Tips
        php.net
        w3schools.com

        Comment


          #5
          i like doing it this way thou!

          Code:
          if(mysql_num_rows(mysql_query("SELECT username FROM $db WHERE username = '$username'")))
          {
          $msg=$msg."Userid already exists. Please try another one<br/>";
          $status= "NOTOK";
          }
          // if all validations are fail.
          if($status<>"OK")
          { 
          echo "$msg";
          // if all validations are passed.
          }else{ 
          echo "That Username is free!";
          }
          Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
          Visit: WapMasterz Coming Back Soon!
          _______
          SCRIPTS FOR SALE BY SUBZERO
          Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
          FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
          _______
          Info & Tips
          php.net
          w3schools.com

          Comment


            #6
            Ok yea i changed the userid you pasted before to my defined variable ;) but ok whats the difference between the the methods posted?
            Last edited by ripkk2tfk; 04.12.09, 22:34. Reason: Sigh at my spelling
            Visit my site

            Comment


              #7
              the one i coded you can add more stuff like email and other stuff like this

              Code:
              if (!stristr($email,"@") OR !stristr($email,".")){
              $msg="Your email address is not correct<br/>"; 
              $status= "NOTOK";}
              
              if(mysql_num_rows(mysql_query("SELECT email FROM members WHERE email = '$email'"))){
              $msg=$msg."Email already exists.<br/>";
              $status= "NOTOK";}
              You can see the status notok

              this will fail the sign up or login.
              Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
              Visit: WapMasterz Coming Back Soon!
              _______
              SCRIPTS FOR SALE BY SUBZERO
              Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
              FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
              _______
              Info & Tips
              php.net
              w3schools.com

              Comment


                #8
                Ok nice i must still learn all this stuff
                Visit my site

                Comment


                  #9
                  I have a m0top script . Its working fine. But i dont see any cetagory . How to create cetagory??
                  PHP Code:
                  /* I don't know everything hehe */ 
                  Find me on facebook

                  Comment


                    #10
                    Change your permissions
                    Visit my site

                    Comment

                    Working...
                    X