Jump to content

Edit, add to, and delete from a certain file


lore_lanu

Recommended Posts

Hey all!

 

So, I am currently working on the backend of my site and I was wondering how I would be able to do something.

 

I would like to enter a string (in this case, an IP address) into a form and have the form add

deny from xxx.xxx.xxx.xxx

to an htaccess file. (to ban the IP)

 

And, to enter the address into a different form and have it search the .htaccess file and delete the line with the IP address entered. (to unban the IP)

 

How could I accomplish this?

 

I'm pretty sure this is possible to do, but is it the most efficient way to ban an IP Address? Would I better off, storing the banned addresses in a database and then deleting them from the mysql row? That seems a little less efficient to me.

 

Thanks in advance for any help and/or advice!

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.