Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How To Ban A Specific IP From Accessing Your Site With PHP
#5
(01-11-2012, 05:33 PM)AceInfinity Wrote: You're going to add this manually for every IP you have to ban though? Huh

You could also go with an .htaccess method

This is just a quick way of banning people from one page, if you wanted to do it for all of them you can make that a lot easier too. Put the code into a file called something like 'inc.php' then just:

PHP Code:
<?php
require 'inc.php'// Do this for every page, and you can copy and paste it to make it even quicker.
?>

Simples.

(01-11-2012, 07:32 PM)Laugh Wrote:
(01-11-2012, 07:27 PM)lovetospooge Wrote: You could just ban the IP in your cPanel, if you use cPanel.

But he is telling us how to do it with PHP.

Exactly, thanks.
Reply


Messages In This Thread
RE: How To Ban A Specific IP From Accessing Your Site - by BreShiE - 01-12-2012, 12:42 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to track bandwidth for specific files and pages? dipped9900 1 861 07-14-2012, 05:25 PM
Last Post: 'Snorlax
  [PHP] - PHP White Paper --([-S7N-])-- 1 1,062 04-13-2010, 09:42 PM
Last Post: SLiM

Forum Jump:


Users browsing this thread: 6 Guest(s)