Mclovin1337 Posted May 6, 2010 Share Posted May 6, 2010 I am really a noob and have no idea how to do it. Thank you Edit-Ok sorry, well when you click a button it gives you something, but I want that button to ban your ip for one hour from the website. Link to comment https://forums.phpfreaks.com/topic/200955-ban-ip-for-one-hour-when-you-click-a-button/ Share on other sites More sharing options...
JAY6390 Posted May 6, 2010 Share Posted May 6, 2010 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 Link to comment https://forums.phpfreaks.com/topic/200955-ban-ip-for-one-hour-when-you-click-a-button/#findComment-1054379 Share on other sites More sharing options...
Mclovin1337 Posted May 6, 2010 Author Share Posted May 6, 2010 Your right sorry, and the button is from a web form. Link to comment https://forums.phpfreaks.com/topic/200955-ban-ip-for-one-hour-when-you-click-a-button/#findComment-1054380 Share on other sites More sharing options...
JAY6390 Posted May 7, 2010 Share Posted May 7, 2010 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 Link to comment https://forums.phpfreaks.com/topic/200955-ban-ip-for-one-hour-when-you-click-a-button/#findComment-1054383 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.