Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi All,
I have been strugling to get fopen to read a remote http file. It times out,
But strangely it works fine if I replace remote url with local host.
Here is my code:Code: Select all
function GetPage($WhoIsServerURL) {
//$handle = fopen("$WhoIsServerURL", "rb") or exit("Unable to open file!"); // Exact url
$handle = fopen("http://www.cyberconnect.co.za", "rb") or exit("Unable to open file!"); //hard-coded url for testing
$contents = '';
while (!feof($handle)) {
$contents .= fread($handle, 8192);
}
fclose($handle);
// print_r($contents); die();
return $contents;
}Thanks in advance
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]