Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

Button that automatically bans users' IP from site?

Title says it all, I'd like a visible button that once clicked bans the clickers IP automatically.

Thanks!
(Jan 1, 2017 06:41 PM)Not Your Average Orange Wrote:  Title says it all, I'd like a visible button that once clicked bans the clickers IP automatically.

Thanks!

You will have to get the users ip and store this in a variable. You will then need to input this into a database(MySQL). You will then need to check a visitors IP against the list of IPs in the database and restrict access if it is in there. This should be able to be done with PHP.

If you research the different parts, you should be able to put them together.

I do not know why you would need to do something like this but its 2am currently so i will take a look in the mourning if i remember.
https://www.sitepoint.com/community/t/ge...ase/5180/4

I'd take a look at some of the suggestions here in some way and then trying to incorporate that adding to the .htaccess file to block users IP.

You'd most likely have to set up a database with PHP and mySQL and save a variable of their IP address when they connect to the site. Then if the button gets clicked, it sends the variable to the database and then the .htaccess gets modified.

That looks like a plausible way of accomplishing what you're after.
Web Designer / Developer & SEO Expert.

View Work
Earn 10% of the job you refer me to!

Skype aerox.design


(Jan 1, 2017 07:05 PM)AshleyUK Wrote:  You will have to get the users ip and store this in a variable. You will then need to input this into a database(MySQL). You will then need to check a visitors IP against the list of IPs in the database and restrict access if it is in there. This should be able to be done with PHP.

If you research the different parts, you should be able to put them together.

I do not know why you would need to do something like this but its 2am currently so i will take a look in the mourning if i remember.

(Jan 2, 2017 02:26 AM)Rushax Wrote:  https://www.sitepoint.com/community/t/ge...ase/5180/4

I'd take a look at some of the suggestions here in some way and then trying to incorporate that adding to the .htaccess file to block users IP.

You'd most likely have to set up a database with PHP and mySQL and save a variable of their IP address when they connect to the site. Then if the button gets clicked, it sends the variable to the database and then the .htaccess gets modified.

That looks like a plausible way of accomplishing what you're after.

Okay, thanks guys.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by seawolve1Jun 9, 2016 07:36 AM 4 106 Jun 9, 2016 07:36 AM
Last Post: seawolve1
by TasemuJan 25, 2014 02:25 AM 0 53 Jan 25, 2014 02:25 AM
Last Post: Tasemu
by JeremyBeamJul 15, 2012 04:25 AM 1 59 Jul 15, 2012 04:25 AM
Last Post: raxe