Computer Forums

Member Login

Remember Me? Sign Up! | Forgot Password
 
Slogan
 
Closed Thread
Old 10-09-2004, 02:38 PM   #11 (permalink)
 
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  
Old 10-09-2004, 03:30 PM   #12 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

really is it so?

like i have to jus put html tags and paste this script in the body adn then save it as .html and it would work..

well lemme see and if it works then hail to you
__________________
Realin Wuz here ...

real_in is offline  
Old 10-09-2004, 03:42 PM   #13 (permalink)
 
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
really is it so?

like i have to jus put html tags and paste this script in the body adn then save it as .html and it would work..

well lemme see and if it works then hail to you
should work.
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
Old 10-09-2004, 03:54 PM   #14 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

no it is not working, i have tried it on lycos, even i tried on microsoft front page on my PC but it doesn't seems to work at all, it shows javascript something in the address bar..
__________________
Realin Wuz here ...

real_in is offline  
Old 10-09-2004, 04:05 PM   #15 (permalink)
 
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
no it is not working, i have tried it on lycos, even i tried on microsoft front page on my PC but it doesn't seems to work at all, it shows javascript something in the address bar..
Ok i tried adding it to index.html too and it didn't work, but if you upload that php script as a single php file, and then hit it with your browser it will work.
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
Old 10-09-2004, 04:12 PM   #16 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

Wait, make a backup of index.html, and delete it, then upload the php script as index.php, then hit your site
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
Old 10-09-2004, 04:14 PM   #17 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

Ok now i will copy and paste it in to notepad adn save it as "ip.php" and then would upload it and then would follow the link let's see what happens??

if u can then contact me on yahoo :: master_blaster_sachin
or on msn :: nba_sachin@hotmail.com
__________________
Realin Wuz here ...

real_in is offline  
Old 10-09-2004, 04:17 PM   #18 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

Upload it as index.php if you want the ip to be logged when a user hits the first page of your website.
__________________
**[System specs]**

Delphi Enterprise 6 - 7
VB 6.0 - 2005 EE
sippin codeine is offline  
Old 10-09-2004, 04:29 PM   #19 (permalink)
 
Super Techie

Join Date: Aug 2004

Posts: 277

real_in

Send a message via Yahoo to real_in
Default

Follow this link which i made as u prompted brother,

but now jus lemme know where is that txt file stored, according to you it should be in the main directory i should be able to see it by changing the later part of this link my .txt thing, lemme try that also..

http://members.lycos.co.uk/realin/index.php
__________________
Realin Wuz here ...

real_in is offline  
Old 10-09-2004, 04:32 PM   #20 (permalink)
 
Super Techie

Join Date: Jun 2004

Posts: 312

sippin codeine

Send a message via Yahoo to sippin codeine
Default

that would give you my ip, lol, you need to go to the site with your browser, and your ip address would be logged, and yes my script places the logfile in the same directory as the script, but that can be modified.
__________________
**[System specs]**

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

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On