I want to fetch the local ip and proxy server address by php code.

Recommended Answers

All 5 Replies

$ipAddress = $_SERVER;
$localIpAddress = $HTTP_SERVER_VARS;

thats becase when you type http://localhost (or whatever the local machine is called) from the machine itself then you will get directed to 127.0.0.1

Put your server online (left click on wamp icon, then put online) and then goto your IP (you said 192.168.0.12) in your browser.

omick16. PHP Server runs off of a web server, aka apache. If your accessing it locally, it can be accessed by 'localhost'. As far as i know, there isn't a function available to tell you the IP address of the machine your running.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.