View Full Version : looking for simple code to unban ip

09-15-2009, 10:05 PM

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

if ($_POST['unbanme'] == "the Victim IP")


function remove_blacklist ($ip)
global $blacklist_file, $htaccess;


09-16-2009, 01:23 AM
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.

09-16-2009, 04:26 AM
thx .. no worry i have workaround way ..