IT Community - Software Programming, Web Development and Technical Support

How to track IPs of clients while requesting page

This is a discussion on How to track IPs of clients while requesting page within the PHP Programming forums, part of the Web Development category; I need to implement the IP tracking feature in a project. While tracking the client IP I found an issue. ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > PHP Programming

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 07-20-2007, 05:45 AM
sureshbabu sureshbabu is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: India
Posts: 101
sureshbabu is on a distinguished road
Send a message via AIM to sureshbabu Send a message via MSN to sureshbabu Send a message via Yahoo to sureshbabu Send a message via Skype™ to sureshbabu
Default How to track IPs of clients while requesting page

I need to implement the IP tracking feature in a project. While tracking the client IP I found an issue. The issue is, while the the page is being hit by a system its actual IP is cannot be traced (Incase a server hits the page). Instead of actual IP some internal IP is traced. (e.g. 192.168.X.XXX like that)

I used
$_SERVER['HTTP_X_FORWARDED_FOR']
$_SERVER['REMOTE_ADDR']

But it works only the client is an individual sys. If a server hits the page means only its internal IP is traced.

Guys any idea????????????????????????????????
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-20-2007, 06:12 AM
sivaramakrishnan sivaramakrishnan is offline
D-Web Programmer
 
Join Date: Feb 2007
Posts: 74
sivaramakrishnan is on a distinguished road
Post Re: How to track IPs of clients while requesting page

Hi,

Here is PHP code:

<html>
<head>
<title>What is my IP address?</title>
</head>
<body>
<?php

if (getenv(HTTP_X_FORWARDED_FOR)) {
$pipaddress = getenv(HTTP_X_FORWARDED_FOR);
$ipaddress = getenv(REMOTE_ADDR);
echo “Your Proxy IPaddress is : “.$pipaddress. “(via $ipaddress)” ;
} else {
$ipaddress = getenv(REMOTE_ADDR);
echo “Your IP address is : $ipaddress”;
}
?>
</body>
</html>

Thanks
sivarman.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-20-2007, 08:27 AM
sureshbabu sureshbabu is offline
D-Web Sr.Programmer
 
Join Date: Jul 2007
Location: India
Posts: 101
sureshbabu is on a distinguished road
Send a message via AIM to sureshbabu Send a message via MSN to sureshbabu Send a message via Yahoo to sureshbabu Send a message via Skype™ to sureshbabu
Thumbs down Re: How to track IPs of clients while requesting page

I told that i already used those variables. Would be better if you suggest me other methods.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Interactions with clients - Useful tips amansundar The Lounge 23 05-01-2008 02:27 PM
'Page' ia an unambiguous reference between 'System.Web.UI.Page' and 'Project1.Page' poornima ASP and ASP.NET Programming 1 03-05-2008 03:12 AM
How do you track your website visitors? montyauto PHP Programming 3 09-11-2007 03:25 AM
Track the mobile user prasath Mobile Software Development 0 07-16-2007 05:54 AM
How can track click? webmaster Search Engine Optimization 1 02-20-2007 04:05 AM


All times are GMT -7. The time now is 06:23 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0