Results 1 to 6 of 6

Thread: IP ban question

  1. #1
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default IP ban question

    Hi,

    Im using IP block for double users script which looks like this:

    PHP Code:
    <?php
    include $_SERVER['DOCUMENT_ROOT'] . '/content/processes/db_conn.php'//db 
    $userIP $_SERVER['REMOTE_ADDR'];
    $IP_check3 mysql_query("SELECT * FROM reg_users WHERE IP='$user_IP'");
    if(
    mysql_num_rows($IP_check) > 0) {exit("Only one user with One IP");} else {*register form*}
    ?>
    Also I have row with IP saved from register page...

    Will this script work without issues?? Because I know about Ip changers and other malware

    Share your opinion...

  2. #2
    Join Date
    Apr 2008
    Location
    So.Cal
    Posts
    3,643
    Thanks
    63
    Thanked 516 Times in 502 Posts
    Blog Entries
    5

    Default

    it may work, but not always as intended. Shared or dynamic IPs, for instance: you may end up blocking legitimate users.

  3. #3
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    As example: I have 3 IP's I think... I dont how it happens, but they are changing automatically.

  4. #4
    Join Date
    Feb 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Try actually storing Useragent data (comes with OS info), as an extra help.

  5. #5
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Useragent data will vary based on OS and browser, so users with two computers or just two browsers won't be effectively banned.


    Banning based on IP is unreliable over a long time, but for just a month or so fairly reliable. You can lift the ban after a month and hope the user has given up by then. At worst, you'll have to reban them after a month. Spammers aren't usually that persistent.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  6. #6
    Join Date
    Aug 2009
    Posts
    399
    Thanks
    42
    Thanked 4 Times in 4 Posts

    Default

    thanks for that

Bookmarks

Posting Permissions

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