Hi,
I am running a proxy, and my browser(firefox) is set to use it. When I check my ip from browser it's the fake ip. But if I write a php script to fetch data from that same site (where I checked my IP) it shows the real IP. How do I make my script to show the fake IP?
Please help.
Heres my code
include_once 'simple_html_dom.php'; $url = "http://www.showmemyip.com"; $html = file_get_html($url); $ret = $html->find('span[id=IPAddress]'); echo $ret[0]."<br/>";
the included file can be found at http://trac.openpolis.it/openpolis/browser/trunk/lib/simple_html_dom.php
your browser is not your web server, how\where is your webserver hosted?
...is on local machine, running apache.
Your webserver has no idea that your browser is configured to use a proxy.
Since PHP is executed by your webserver (and not your browser, of course), the proxy is never used by PHP.
Is there any way for my PHP to use the proxy (when running on local host). Or how can I setup my web server (apache) to use proxy.
If you use the [man]cURL[/man] extension, you should be able to use the CURLOPT_PROXY option (see [man]curl_setopt/man) to use the proxy instead of making a direct request to the remote server.