Cannot Register with same IP

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

    Cannot Register with same IP

    Hye all,

    Need your assistance to provide code for cannot register with same IP. i already search in this coding-talk but couldnt find the answer. Hopefully you can assist me.

    #2
    ALTER TABLE users
    ADD UNIQUE (ip)

    Comment


      #3
      ok.. and then? surely need to put some php code right?

      Comment


        #4
        you do realise this will really limit the potential number of members you have don't you?

        Comment


          #5
          Originally posted by woody View Post
          you do realise this will really limit the potential number of members you have don't you?
          I'm sure he doesnt realise that...
          UNIQ `email` and ofcourse valid one, would be better solution
          Last edited by metulj; 27.04.12, 21:30.
          It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
          ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
          ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
          キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

          Comment


            #6
            Originally posted by woody View Post
            you do realise this will really limit the potential number of members you have don't you?
            im realise on that. but, mostly user in my country doesn't use same ip nowdays.

            Comment


              #7
              Originally posted by sharil View Post
              im realise on that. but, mostly user in my country doesn't use same ip nowdays.
              if you got mostly mobile users, they surelly use shared IP...
              and even for PC users that wont be good...
              think about dynamic IP's...
              user will register with dynamic IP,
              then same IP will gain another user sooner or later,
              and it wont be able to register as IP will be already in DB...
              It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
              ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
              ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
              キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

              Comment


                #8
                As the other guys said, limiting IP is not good.

                Still... If you searching for code solution instead of database solution, you can do something like this in your php code:

                PHP Code:
                <?php

                $ip 
                $_SERVER['REMOTE_ADDR'];

                if(
                mysql_num_rows(mysql_query("SELECT * FROM users WHERE ip='$ip'"))==0) {
                // register script
                }
                else {
                // ip already registered
                }

                ?>
                mysterio.al - programming is a functional art

                Comment

                Working...
                X