Connecting Tech Pros Worldwide Forums | Help | Site Map

ip address question (trouble with remote_addr)

ojorus
Guest
 
Posts: n/a
#1: Jun 2 '06
Hi.
I have a problem when I use the $_SERVER['remote_addr'].
I'm testing a script, and the strange thing is that remote_addr returns an
ip-address only sometimes, and not always. Why can that be?
Are there any other (better) methods of getting the ip-address?

Ojorus



Erwin Moller
Guest
 
Posts: n/a
#2: Jun 2 '06

re: ip address question (trouble with remote_addr)


ojorus wrote:
[color=blue]
> Hi.
> I have a problem when I use the $_SERVER['remote_addr'].
> I'm testing a script, and the strange thing is that remote_addr returns an
> ip-address only sometimes, and not always. Why can that be?
> Are there any other (better) methods of getting the ip-address?
>
> Ojorus[/color]

Hi Ojorus,

That is suprising because that IP is used to send the response to.
Can you reproduce the empty $_SERVER['remote_addr'] yourself?

What setup are you using? PHP-version/OS/webserver?

Regards,
Erwin Moller
Erwin Moller
Guest
 
Posts: n/a
#3: Jun 2 '06

re: ip address question (trouble with remote_addr)


Erwin Moller wrote:
[color=blue]
> ojorus wrote:
>[color=green]
>> Hi.
>> I have a problem when I use the $_SERVER['remote_addr'].
>> I'm testing a script, and the strange thing is that remote_addr returns
>> an ip-address only sometimes, and not always. Why can that be?
>> Are there any other (better) methods of getting the ip-address?
>>
>> Ojorus[/color]
>
> Hi Ojorus,
>
> That is suprising because that IP is used to send the response to.
> Can you reproduce the empty $_SERVER['remote_addr'] yourself?
>
> What setup are you using? PHP-version/OS/webserver?[/color]

One addition: according to
http://koivi.com/apache-iis-php-server-array.php
both IIS and Apache support remote_adres.
[color=blue]
>
> Regards,
> Erwin Moller[/color]

ojorus
Guest
 
Posts: n/a
#4: Jun 2 '06

re: ip address question (trouble with remote_addr)


Hi!
The server where the php-script is located is Apache/1.3.33. (Shared host)
X-Powered-By: PHP/5.0.4

When I test the script locally on my apache-installation, everything works
fine. But when I upload it to the server I use, the strange error occour;
the IP-address is only returned from time to time, and not always.
It also seems that when the server is quite busy, the problem increases.

I don't have a clue how to solve this...

Ojorus

"Erwin Moller"
<since_humans_read_this_I_am_spammed_too_much@spam yourself.com> skrev i
melding news:4480128f$0$31655$e4fe514c@news.xs4all.nl...[color=blue]
> ojorus wrote:
>[color=green]
>> Hi.
>> I have a problem when I use the $_SERVER['remote_addr'].
>> I'm testing a script, and the strange thing is that remote_addr returns
>> an
>> ip-address only sometimes, and not always. Why can that be?
>> Are there any other (better) methods of getting the ip-address?
>>
>> Ojorus[/color]
>
> Hi Ojorus,
>
> That is suprising because that IP is used to send the response to.
> Can you reproduce the empty $_SERVER['remote_addr'] yourself?
>
> What setup are you using? PHP-version/OS/webserver?
>
> Regards,
> Erwin Moller[/color]


Gordon Burditt
Guest
 
Posts: n/a
#5: Jun 2 '06

re: ip address question (trouble with remote_addr)


>I have a problem when I use the $_SERVER['remote_addr'].[color=blue]
>I'm testing a script, and the strange thing is that remote_addr returns an
>ip-address only sometimes, and not always. Why can that be?
>Are there any other (better) methods of getting the ip-address?[/color]

Some IP addresses have no reverse DNS. If it's intermittent for
the SAME IP address on different hits, maybe you're having trouble
with DNS lookups.

Gordon L. Burditt
Closed Thread