473,320 Members | 1,951 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Inconsistent IP address extracted with PHP - Give me a hint, please!

Dear All,

I'm not new in PHP at all but it's the first time when I used the variable
_SERVER[REMOTE_ADDR].
I need to track for my client, the vistors IP addresses but I got stuck with
this
problem:
I have a cable access at home so I have dedicated ( fixed IP address) and I
tried to record on my server side php script my IP address from home, but I
got always 2 distinct IP addresses: one is x.y.z.204 when I type directly
the PHP script URL from the server into my browser and the second one is
x.y.z.236 when I used a booked link (from my browseer favorites) to the same
PHP URL on the server and also when I use a http link from any html document
towards the same above mentioned PHP URL on the server.
So, I get reported 2 IP addresses of my home computer when I try to record
on a php side script my home computer IP address always the same in the
above mentioned circomstances.
I've tried it for almost 2 days with the same results.
Any hints would be greatly appreciated.

Daniel P.

Jul 17 '05 #1
2 1840
Daniel Pope <da*******@shaw.ca> wrote:
_SERVER[REMOTE_ADDR].
I need to track for my client, the vistors IP addresses
There are many reasons _not_ to track ip addrs, you might be running
into one of them.
problem: I have a cable access at home so I have dedicated ( fixed IP address)
and I tried to record on my server side php script my IP address from
home, but I got always 2 distinct IP addresses: one is x.y.z.204 when
I type directly the PHP script URL from the server into my browser
and the second one is x.y.z.236 when I used a booked link (from my
browseer favorites) to the same PHP URL on the server and also when I
use a http link from any html document towards the same above
mentioned PHP URL on the server.


It's not probable that your problem has somehting to do with PHP.

You know your fixed ipaddress, is it one of the 2 you mentioned? My
guess is that you passing thru a (transparent) loadbalancing proxy.
There are hints in the $_SERVER array (like the keys 'via',
'x_forwarded_for' or 'client_ip').

--

Daniel Tryba

Jul 17 '05 #2
"Daniel Pope" <da*******@shaw.ca> wrote in message news:<8Vmfc.122074$Ig.70434@pd7tw2no>...
Dear All,

I'm not new in PHP at all but it's the first time when I used the variable
_SERVER[REMOTE_ADDR].
I need to track for my client, the vistors IP addresses but I got stuck with
this
problem:
I have a cable access at home so I have dedicated ( fixed IP address) and I
tried to record on my server side php script my IP address from home, but I
got always 2 distinct IP addresses: one is x.y.z.204 when I type directly
the PHP script URL from the server into my browser and the second one is
x.y.z.236 when I used a booked link (from my browseer favorites) to the same
PHP URL on the server and also when I use a http link from any html document
towards the same above mentioned PHP URL on the server.
So, I get reported 2 IP addresses of my home computer when I try to record
on a php side script my home computer IP address always the same in the
above mentioned circomstances.
I've tried it for almost 2 days with the same results.
Any hints would be greatly appreciated.


You may need i2c_realip() available at
<http://in.php.net/source.php?url=/include/ip-to-country.inc>

--
http://www.sendmetoindia.com - Send Me to India!
Email: rrjanbiah-at-Y!com
Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Chang | last post by:
I am trying to do some analysis on customer's locality, so I'd like to extract numeric part from address. Here is how the table looks like Table Member first_name last_name address1 ...
117
by: Steevo | last post by:
Any suggestions as to the best programs for cloaking email addresses? Many thanks -- Steevo
3
by: Bernd Giegerich | last post by:
Hi, we had a strange problem with DB2 8.2 Enterprise Edition on Windows 2003 (Standard) Server. We installed DB2 8.2 (8.1.7) directly on a naked W2K3 system (no migration, no update -> no...
3
by: aditya | last post by:
hi all can anybody please tell me that how a C compiler searches for the defintion of the standard functions like scanf,printf,etc? Does the compiler knows in advance the location in memory...
27
by: jimbo | last post by:
Could someone comment on this code please. 1. Are the comments in it correct? 2. Why does sizeof(arr) not work consistently in C? In someFunction() sizeof(arr) means sizeof(&arr) in main. ...
7
by: Doug Stell | last post by:
I am having a problem with the corruption of a list. It occurs only the first time that I call a function and never happens on subsequent calls. Any suggestions would be appreciated. I call the...
20
by: Francine.Neary | last post by:
I am learning C, having fun with strings & pointers at the moment! The following program is my solution to an exercise to take an input, strip the first word, and output the rest. It works fine...
4
by: akhilesh.noida | last post by:
I am trying to write a program that can verify an email address without sending mail to it. any hint/clue will be quite useful to me.
5
by: Jetus | last post by:
I have a comma delimited file that is separated by comma's, and then sometimes by "," c:\temp\05-06-08\Sale1,659 CECIL,"659 CECIL,40211", 1,659,CECIL,AVENUE,LOUISVILLE,40211,"$65,276.78 "...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.