Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Aug 2009
    Posts
    215
    Thanks
    74
    Thanked 0 Times in 0 Posts

    looking for simple code to unban ip

    Hello

    I have Some Bad IPs Banned thru .htaccess , i need simple file to unban some people from the file htaccess by tyeping the ip in a box and hit submit , i do it now manualy by downloading the htaccess and then look for the ip i need to unban .. there should be Easy way .. Right ..

    Maybe somthing like this but not sure
    PHP Code:
    <?php
    if ($_POST['unbanme'] == "the Victim IP")
      {
        
    remove_blacklist($REMOTE_ADDR);
    ?>
    function
    PHP Code:
    function remove_blacklist ($ip)
    {
      global 
    $blacklist_file$htaccess;

            { 
    Last edited by ajloun; 09-15-2009 at 09:10 PM.

  • #2
    Regular Coder
    Join Date
    May 2009
    Location
    Moore, OK
    Posts
    282
    Thanks
    11
    Thanked 41 Times in 41 Posts
    Maybe try using php to open the .htaccess file, then use preg_replace to delete it, and save the version back to the file. I don't know if it will allow you to because I have never tried, but seems like a BIG security risk if it is allowed to.

  • #3
    Regular Coder
    Join Date
    Aug 2009
    Posts
    215
    Thanks
    74
    Thanked 0 Times in 0 Posts
    thx .. no worry i have workaround way ..


  •  

    Posting Permissions

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