Jump to content

How to get server IP address


abdfahim

Recommended Posts

wait .. I think I am making u confused ... I am trying to explain it more ...

let my server's IP is 150.160.170.180 ... When i use the code

echo $_SERVER['SERVER_ADDR'];

in a php page, any visitor visits my page will see this IP address - 150.160.170.180. But if I visit my page from the server itself from localhost, it will definite show 127.0.0.1. But I need to show the external IP of my server page, as my server has a dynamic IP address, so that anyone can just come to the server and note its current IP in case the IP had changed. By the way, its a small home network.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.