Need urgent help with conditional echo of file

1link

Junior Member
Joined
Dec 9, 2008
Messages
100
Reaction score
200
I want to do something like this:

Code:
<?php
$ipaddress = $_SERVER["REMOTE_ADDR"];
$content = file_get_contents('adfly.php');

if ($ipaddress=='14.98.14.230')
    {
    echo $content;
    }
?>

But it doesn't seems to be working, the purpose is to show ads, only to a specific group of people and turn of ads for others.

Please help
 
Code:
<?php
$ipaddress = $_SERVER["REMOTE_ADDR"];
if ($ipaddress=='14.98.14.230') {
    require 'adfly.php';
}
?>
 
Thanks, this is what I was exactly looking for. This is why no books or computer can substitute actual people :-D

Code:
<?php
$ipaddress = $_SERVER["REMOTE_ADDR"];
if ($ipaddress=='14.98.14.230') {
    require 'adfly.php';
}
?>
 
Yep, you were echo'ing the contents of the PHP file instead of actually executing it.
 
Back
Top