Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tutorial] How to grab IP adress with PHP
#13
(03-12-2010, 04:41 PM)TheLifelessOne Wrote: How would you exclude a specific IP from being detected?
Add an if statement to filter out the IP.
Then log anything that isn't equal to the IP specified.

PHP Code:
<?php
$ip 
$_SERVER['REMOTE_ADDR'];
$filterip "localhost";

if (
$ip == $filterip)
{
echo(
"Welcome!");
}
else
{
echo(
"You are not welcome here!");
}
?>

Hope this helped Big Grin
Reply


Messages In This Thread
RE: [Tutorial] How to grab IP adress with PHP - by Unwanted - 04-11-2010, 12:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  PHP Framework List: An Ultimate Guide to 102 PHP Frameworks for Web Developers tk-hassan 0 956 07-27-2020, 11:26 PM
Last Post: tk-hassan
  PHP Video Tutorials (PHP For Beginners) Eleqtriq 4 3,705 10-10-2011, 01:00 PM
Last Post: Greyersting
  Tim's PHP 101 tutorial Tim 22 6,234 10-19-2009, 02:12 PM
Last Post: Tim
  PHP mysql Login Tutorial By MAcar V1.0 MAcar 8 4,053 10-08-2009, 04:57 PM
Last Post: MAcar
  PHP site backup tutorial andrewjs18 6 2,277 10-07-2009, 11:27 PM
Last Post: andrewjs18

Forum Jump:


Users browsing this thread: 9 Guest(s)