Re: Strange results from file_get_contents using an url as filename

From: Date: Tue, 28 Dec 2004 15:49:56 +0000
Subject: Re: Strange results from file_get_contents using an url as filename
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-205250@lists.php.net to get a copy of this message
Ewout de Boer wrote:
I'm getting unexpected data from my file_get_contents function using an url as filename. The function does not return false, i do get data from it. Problem is that is is not the data is requested. $data = file_get_contents("http://somehost.com/xmlonl.asp?custid=000000&prodid=00000 "); if ($data) { ... the string this function returns is the webpage from the default website of the server where this php code is running at and not the data from the remote site (which is not on the same server). i tried the url from my shell on the server using telnet and it gets the data i expected. I can't figure out why php is getting the wrong results while telnet on the same host gets the correct data. Is this a (known) error with php or is it a apache/php/server configuration problem ? regards, Ewout *Check your PHP runtime config to see if 'allow_url_fopen' is enabled. (You can view your configuration using 'phpinfo'. You can change it in your php.ini file.)
(See the first tip in the fine manual: http://us4.php.net/manual/en/function.file-get-contents.php ) ** -John *

« previous php.general (#205250) next »