I want to do something like this: <?php $ipaddress = $_SERVER["REMOTE_ADDR"]; $content = file_get_contents('adfly.php'); if ($ipaddress=='14.98.14.230') { echo $content; } ?> Code (markup): The purpose is to show ads only to a specific group of people and turn of ads for others. Please help
There doesn't really seem to be anything wrong with the code as far as I can tell. The only things that may be preventing it from working would be that you don't have permissions to read the file or there is something wrong in adfly.php. If you could post the server error_logs and/or the contents of the adfly.php file, that would make it much easier to debug. However, if you are looking to execute the adfly.php instead of just write the contents, you may want to go with something like this: if ($_SERVER['REMOTE_ADDR'] == '14.98.14.230') { require_once 'adfly.php'; } PHP: