I have a script that includes 2 files, and in each of those files file_get_contents() calls a site using HTTP. In the first file, the code is like this:
CODE
$site1_url = "http://some.site.com?exp=0&query=$term&x=30";
$site1_contents = @file_get_contents$site1_url);
[code]
This works fine, no errors are thrown, and everything is as it is supposed to be. In my second file, it's pretty much the same thing:
[code]$site2_url = "http://www.site.com/partner.jsp?q=$term";
$site2_contents = file_get_contents($site2_url);
$site1_contents = @file_get_contents$site1_url);
[code]
This works fine, no errors are thrown, and everything is as it is supposed to be. In my second file, it's pretty much the same thing:
[code]$site2_url = "http://www.site.com/partner.jsp?q=$term";
$site2_contents = file_get_contents($site2_url);
However, for the second file, I get an error:
CODE
Warning: file_get_contents(http://www.site.com/partner.jsp?q=some+thing) [function.file-get-contents]: failed to open stream: Connection timed out in /home/michael/public_html/path/to/file.php on line 6
Does anyone know what might be causing this, as it really has me baffled.
Thanks,
Michael Boutros