rossmcl
Programmer
- Apr 18, 2000
- 128
Hi,
I use the following code to store the IP address of a visitor to my site. It worked perfectly...until I recently changed ISP.
This new ISP doesnt give me a static IP address. So I am wondering, does anyone know of a cunning way in PHP so that when I enter my website, it doesnt store my IP details and skey my visitor numbers. Can I use IPCONFIG in php or something . . . hmm, I am not sure if this is possible, but would really appreciate if any php experts have a cunning ploy!
Much appreciated as always
Rossmcl
===
<?php
$filename = "VisitorsDetailsBlog.txt";
$handle = fopen ($filename, "a+");
$todaydate = date("Y-m-d H:i:s");
$visitorInfo = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$url = $_SERVER['REQUEST_URI'];
$test = $_SERVER[HTTP_REFERER];
if ($visitorInfo == "212.126.131.105")
{
//do nothing
}
else
{
fwrite($handle, "\r\n" . $todaydate . ' ' . $visitorInfo . ' ' . $test . ' ' . $url);
}
fclose( $handle );
?>
I use the following code to store the IP address of a visitor to my site. It worked perfectly...until I recently changed ISP.
This new ISP doesnt give me a static IP address. So I am wondering, does anyone know of a cunning way in PHP so that when I enter my website, it doesnt store my IP details and skey my visitor numbers. Can I use IPCONFIG in php or something . . . hmm, I am not sure if this is possible, but would really appreciate if any php experts have a cunning ploy!
Much appreciated as always
Rossmcl
===
<?php
$filename = "VisitorsDetailsBlog.txt";
$handle = fopen ($filename, "a+");
$todaydate = date("Y-m-d H:i:s");
$visitorInfo = $HTTP_SERVER_VARS['REMOTE_ADDR'];
$url = $_SERVER['REQUEST_URI'];
$test = $_SERVER[HTTP_REFERER];
if ($visitorInfo == "212.126.131.105")
{
//do nothing
}
else
{
fwrite($handle, "\r\n" . $todaydate . ' ' . $visitorInfo . ' ' . $test . ' ' . $url);
}
fclose( $handle );
?>