Post: How do i block someones ip from my website?!
06-08-2011, 10:03 PM #1
(adsbygoogle = window.adsbygoogle || []).push({}); How do i block someones ip from my website?! and is it possible?!
(adsbygoogle = window.adsbygoogle || []).push({});
06-08-2011, 10:36 PM #2
<Jimbo>
</Jimbo>
Really simple... Just put this before the <!DOCTYPE> Declaration.... (At the very top).

    <?php
$deny = array("IP ADDRESS GOES HERE", "", "");
if (in_array ($_SERVER['REMOTE_ADDR'], $deny)) {
header("location: https://WHERE TO DIRECT THEM IF THEY ARE BANNED");
exit();
}
?>



Note: If you have your if your webpage is ".html" you will have to re-save it as ".php" Smile
Originally posted by zedman View Post
How do i block someones ip from my website?! and is it possible?!

The following user thanked <Jimbo> for this useful post:

zedman

Copyright © 2026, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo