file_get_contents() and localhost
Posted: Fri Mar 23, 2007 6:14 am
Hi everyone!
I have a problem in getting a web page through a file_get_contents() request.
If a make
everything is fine.
But if I have a script on my pc, that does something and at the end returns a web page doing so:
simply displays the source code of my script!
In addition my script accept parameters passed via get, so if a make such a request
it gives me an error: failed to open stream: HTTP request failed!
If I put in my browser it works fine, getting me the response I want.
How can I manage to do the same thing via a php script?
Thanks
I have a problem in getting a web page through a file_get_contents() request.
If a make
Code: Select all
echo file_get_contents("www.google.com");But if I have a script on my pc, that does something and at the end returns a web page doing so:
Code: Select all
echo file_get_contents("http://localhost/myscript.php");In addition my script accept parameters passed via get, so if a make such a request
Code: Select all
echo file_get_contents("http://localhost/myscript.php?parameter1=par");If I put
Code: Select all
http://localhost/myscript.php?parameter1=parHow can I manage to do the same thing via a php script?
Thanks