Hi,

I've been trying to set up a counter on my site and in the process have tried several prefab counter scripts.

The scripts all return 127.0.0.1 on the dev system and the ip of the server on the production system. phpinfo() shows correct REMOTE_ADDR.
HTTP_X_FORWARDED_FOR and HTTP_CLIENT_IP, etc return nothing.

Dev system is running Apache 2.0.50 and php 4.3.8
I have mod_proxy on this system, however I have disabled proxying in the conf file. (have also tried a rewrite rule to add http-x-forwarded-for, but it didn't work for me.

Production system is running Apache 1.3.33 php 4.3.10. Not 100% sure about its apache mods (it's my hosts server)

Can anyone provide some insight into this issue?
Any help appreciated.

    127.0.0.1 Is the loopback IP address. Anything sent to this IP addr is not transmitted but stays within the IP Stack. It's generally just used to test that the IP software is working, it is a dummy address if you like.

      Thanks for the reply, but I am fully aware of what the loopback address is. In my original question, I stated that another server displays the IP address of that server - itself. PHP should be displaying the IP address of the remote system with $_SERVER["REMOTE_ADDR"] and not the server's address, loopback or otherwise.

      I'm sorry, but I don't think you read my post correctly.

        So I re-read it twice and all I see is

        The scripts all return 127.0.0.1 on the dev system and the ip of the server on the production system.

        So, what is the question? And WHERE IS IT in your original post.

        (get snotty with me at your peril)

          Sorry if you took this as a snotty response, however I thought the question was quite clear and I didn't see the relevance of your reply.

          All I'm asking is why am I getting the ip address of the server that the script is residing on as the response to $_SERVER["REMOTE_ADDR"] when it should be the ip address of the client.

          phpinfo() shows the correct remote address in the environment variables.

            Write a Reply...