Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-15-2009, 09:05 PM   PM User | #1
ajloun
Regular Coder

 
Join Date: Aug 2009
Posts: 215
Thanks: 74
Thanked 0 Times in 0 Posts
ajloun has a little shameless behaviour in the past
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..
ajloun is offline   Reply With Quote
Old 09-16-2009, 12:23 AM   PM User | #2
Coyote6
Regular Coder

 
Join Date: May 2009
Location: Moore, OK
Posts: 277
Thanks: 10
Thanked 41 Times in 41 Posts
Coyote6 is an unknown quantity at this point
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.
Coyote6 is offline   Reply With Quote
Old 09-16-2009, 03:26 AM   PM User | #3
ajloun
Regular Coder

 
Join Date: Aug 2009
Posts: 215
Thanks: 74
Thanked 0 Times in 0 Posts
ajloun has a little shameless behaviour in the past
thx .. no worry i have workaround way ..
ajloun is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:23 AM.


Advertisement
Log in to turn off these ads.