Block visitor IP or bot user agent with IF Statement PHP
- By Chris
Block a visitor's IP address from viewing a webpage or website with the PHP snippet below.
...
Code:
<?php
if ($_SERVER['REMOTE_ADDR']=="90.6.400.191"){
echo "You do not have permission to view this page";
exit();
}
?>