Cannot Register with same IP

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

  • Mysterio
    replied
    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
    }

    ?>

    Leave a comment:


  • metulj
    replied
    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...

    Leave a comment:


  • sharil
    replied
    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.

    Leave a comment:


  • metulj
    replied
    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.

    Leave a comment:


  • woody
    replied
    you do realise this will really limit the potential number of members you have don't you?

    Leave a comment:


  • sharil
    replied
    ok.. and then? surely need to put some php code right?

    Leave a comment:


  • something else
    replied
    ALTER TABLE users
    ADD UNIQUE (ip)

    Leave a comment:


  • sharil
    started a topic Cannot Register with same IP

    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.
Working...
X