I'm trying to load content from a different page if the user came to the page with NO referrer or if the user types my page in directly.
This is the code I would like to alter to be able to achieve this.
The code below redirects based on if the user has 1 of the IPs listed below, it will load the fakepage.php
. I would like to alter this script so it can work if there is NO referrer, or if the user types in my url directly.
<?php
$banned = array('56.150.186.229','89.103.221.49');
$userIP = $_SERVER['SERVER_ADDR'];
if(in_array($userIP,$banned)) {
include_once('fakepage.php');
} else {
include_once('realpage.php');
}
?>
I'm trying to make this look as seamless as possible, so the user will not know they were redirected