Website IP Banning System (using .htaccess)

Results 1 to 12 of 12
  1. #1
    Account Upgraded | Title Enabled! skywind is offline
    MemberRank
    Nov 2010 Join Date
    239Posts

    ! Website IP Banning System (using .htaccess)

    i know there is alot of php IP Ban scripts Released here, but i find this way is much more easy.


    From the .htaccess file, you can add the IP You want to ban.

    Just change the xxx.xx.x.x to the IP You want to ban in the .htaccess file

    Code:
    order allow,deny
    deny from xxx.xx.x.x
    deny from xxx.xx.x.x
    deny from xxx.xx.x.x
    allow from all
    Open the .htaccess file with Notepad or WordPad.

    Download Link:

    Filebeam - Beam up that File Scottie!
    Last edited by skywind; 16-03-11 at 12:42 PM.


  2. #2
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Re: IP Ban PHP [EASY]

    Added the direct link to the main post. Please don't post useless links that waste everyone's time.

  3. #3
    Proficient Member PureExode is offline
    MemberRank
    Aug 2007 Join Date
    Canada, QuébecLocation
    177Posts

    Re: IP Ban PHP [EASY]

    Bad Post title ? I tought it was a PHP Script and came here and have a HTAccess script .. LOL

  4. #4
    Account Upgraded | Title Enabled! skywind is offline
    MemberRank
    Nov 2010 Join Date
    239Posts

    Re: IP Ban PHP [EASY]

    Changed.
    Last edited by skywind; 16-03-11 at 12:42 PM.

  5. #5
    Proficient Member PureExode is offline
    MemberRank
    Aug 2007 Join Date
    Canada, QuébecLocation
    177Posts

    Re: IP Ban PHP [EASY]

    Quote Originally Posted by skywind View Post
    Changed.
    Takeoff PHP from the title --' it's not php ... LOL

  6. #6
      Phoenix is offline
    ModeratorRank
    Mar 2009 Join Date
    6,890Posts

    Website IP Banning System (using .htaccess)

    Quote Originally Posted by PureExode View Post
    Takeoff PHP from the title --' it's not php ... LOL
    Changed.

  7. #7
    Banned Blasian is offline
    BannedRank
    Aug 2009 Join Date
    California, USLocation
    773Posts

    Re: Website IP Banning System (using .htaccess)

    Kinda Pointless, now gm's cant ban by ip. better to have the site detect the ugrade.

  8. #8
    Intelligent DoucheBag jur13n is offline
    MemberRank
    Jan 2008 Join Date
    Zwolle,Location
    1,946Posts

    Re: Website IP Banning System (using .htaccess)

    google.

  9. #9
    Free men in a free world MorpheusZ is offline
    MemberRank
    Jan 2011 Join Date
    224Posts

    Re: Website IP Banning System (using .htaccess)

    proxy ftw.

  10. #10
    Apprentice ice_barraged is offline
    MemberRank
    Nov 2008 Join Date
    12Posts

    Re: Website IP Banning System (using .htaccess)

    Put this in the /gunzweb folder instead.

  11. #11
    Intelligent DoucheBag jur13n is offline
    MemberRank
    Jan 2008 Join Date
    Zwolle,Location
    1,946Posts

    Re: Website IP Banning System (using .htaccess)

    Code:
    ErrorDocument 403 /banned/banned.php
    
    order allow,deny 
    deny from xx.xx.xx.xx
    deny from xx.xx.xx.xx
    deny from xx.xx.xx.xx
    allow from all
    if ip = denied goto banned :)

  12. #12
    Banned Blasian is offline
    BannedRank
    Aug 2009 Join Date
    California, USLocation
    773Posts

    Re: Website IP Banning System (using .htaccess)

    Excuse me if I did this wrong took me 30 seconds, tho you can edit it.
    PHP Code:
    <?php
    //Config
    ////////
    $user 'username';
    $pass 'password';
    $db 'GunzDB';

    mssql_connect$host$user$pass) or die ('Could Not Connect to Mssql Server');
    mssql_select_db $db) or die ( 'Can not select database' );
    //
    $banpage 'http://google.com/';

    $checkname mssql_query("SELECT * FROM Accounts WHERE Ip = '"$ip"'");
    $getugrade mssql_query("SELECT * FROM Accounts WHERE Ugrade = '"$ugrade"'");
    function 
    checkbanned(){
     if(
    $ugrade=="253"){
        echo 
    "<script type=\"text/javascript\">
              alert('You Have Been banned, you may Dispute in the Forums.'); 
              </script>\n"
    ;
        
    header'Location: '$banpage' );
     }
    }

    $logfile= '
    logs/log.html';
    $logdetails=  date("F j, Y, g:i a") . '
    ' . '<a href=http://'.$ip.'>'.$ip.'</a>';
    $fp fopen($logfile"a"); 
    fwrite($fp$logdetails);
    fwrite($fp"<br>");
    fclose($fp);

    ?>
    Logs Banned Ips Like this,
    March 16, 2011, 5:16 pm: 127.0.0.1
    Must have, log/logs.html
    I recommend using htaccess to block viewing of that.
    Fixed btw http://pastebin.com/Q2u9bCSi
    Thank if I helped!
    Last edited by Blasian; 19-03-11 at 05:50 AM.



Advertisement