By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,877 Members | 1,064 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,877 IT Pros & Developers. It's quick & easy.

ip address question (trouble with remote_addr)

P: n/a
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
Jun 2 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
ojorus wrote:
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


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
Jun 2 '06 #2

P: n/a
Erwin Moller wrote:
ojorus wrote:
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
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?


One addition: according to
http://koivi.com/apache-iis-php-server-array.php
both IIS and Apache support remote_adres.

Regards,
Erwin Moller


Jun 2 '06 #3

P: n/a
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"
<si******************************************@spam yourself.com> skrev i
melding news:44***********************@news.xs4all.nl...
ojorus wrote:
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


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

Jun 2 '06 #4

P: n/a
>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?


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
Jun 2 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.