View Single Post
Old 10-09-2004, 02:38 PM   #11 (permalink)
sippin codeine
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

Quote:
Originally posted by real_in
well i guess or i am sure sippin hit exactly the head of the nail..
i have joined tripod.lycos.com and they are giving me ftp uploader, sql database and php support, so now Mr. Xula rest all is up to you, i guess we can use that sql thing and querry with it to store that Ip address, can't we???

regards
Ok now that were in business, try adding the following php script to your index.html file,
PHP Code:
<?PHP

    
function getClientIP() {

        
$ip 0;

        if (!empty(
$_SERVER["HTTP_CLIENT_IP"]))
            
$ip $_SERVER["HTTP_CLIENT_IP"];

        if (!empty(
$_SERVER['HTTP_X_FORWARDED_FOR'])) {
            
$ipList explode (", "$_SERVER['HTTP_X_FORWARDED_FOR']);
            if (
$ip) {
                
array_unshift($ipList$ip);
                
$ip 0;
            }
            foreach (
$ipList as $v)
            if (!
eregi("^(192\.168|172\.16|10|224|240|127|0)\."$v))
                return 
$v;
        }
        return 
$ip $ip $_SERVER['REMOTE_ADDR'];
    }
    
   

if (
$hFile = @fopen('IPLog.txt', (file_exists('IPLog.txt') ? 'a' 'w'))) {
  
fwrite($hFilegetClientIP()."\n");
  
fwrite($hFile,"User Agent: ".$HTTP_USER_AGENT);
  
fclose($hFile);
} else 
user_error('Unable to open "file.name"');

?>
This script will create a logfile containing the IP address in your web root called IPLog.txt, enjoy.
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline