PDA

View Full Version : Content based by IP


bahawolf
03-31-2005, 08:53 PM
I'm looking to play a trick on my friend because he is Head of Security, I'd like this hacked page that I made in HTML to display, only to him because of his IP.
So far I have this code, and I'd like to insert it into index.php so it'd affect the main page.. any clues where to go next?

$userip = 'the IP of the person';
if ($_SERVER['REMOTE_ADDR'] == $userip OR $_SERVER['HTTML_CLIENT_IP'] == $userip)
{
// this is the person's IP address, so go ahead and do what you want
}
else
{
// this is not the person's IP, so do the normal thing
}

Thanks to daemon at vbulletin.com for giving me the above code, and he reccomended to get further help here. Thanks in advance.

Dean C
03-31-2005, 09:02 PM
$userip = 'the IP of the person';
if ($_SERVER['REMOTE_ADDR'] == $userip OR $_SERVER['HTTML_CLIENT_IP'] == $userip)
{
// this is the person's IP address, so go ahead and do what you want
include_once('somehtmlpage.html');
die;
}



Put that code you used in the phpinclude_start template :)

noppid
03-31-2005, 09:04 PM
You guys are mean, but clever.

twoseven
03-31-2005, 10:06 PM
oh yea tomorrow is april 1st

bahawolf
04-01-2005, 01:50 AM
Thank you very much.. it worked out great. :)