Jump to content

Ban ip for one hour when you click a button


Mclovin1337

Recommended Posts

You should actually take some time to explain your question. Ban an IP from what? the server, your individual application? And where is the button from? A web form? Simple things but you need to put some time into your questions if you are going to ask them

If the site runs through a bootstrap (ie all requests go through a single file) then you could save the ip's to a database, and check them against the db of banned ip's. If it's for individual pages, you can do something similar only you would need to include your checking code at the top of each page.

If you want a server wide ban (that is from everything, webpages or not) then you would need to do this with a .htaccess file containing the list of banned ip's

Check out this link

http://blamcast.net/articles/block-bots-hotlinking-ban-ip-htaccess

at the ban an ip address section

You could dump the data into the htaccess file say every 5 mins from the database list of banned ip's using a cron job or something like that

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.