Hi. I'm using the following to open a URL but the script fails. I t gives me an error in the log file about a bad file descriptor in the fopen command and the script timeouts.
$fp = fopen ("http://www.domain.com", "r");
if (!$fp) {
show_error("The page does not exist");
} else {
while (!feof ($fp)) {
$buffer = fgets($fp, 4096);
$created_content .= $buffer;
}
fclose ($fp);
}
print $created_content;
If i use http://localhost in the fopen() it retrieves the page, it shows it and it pop ups a message "Out of stack space" error. It's external URL s that doesn't open them at all.
How can i open a url and retrieve its content?
Thanks
John