There is no support for redirected urls yet.
Use the 'direct' url instead:
$fcontents = file ('http://www.php.net/');
That works. (note the trailing / ?)
--Jani
On Fri, 22 Jun 2001, Joris Van Droogenbroeck wrote:
>Hi,
>
>I'm trying to read some webpage in a file.
>I've got some code from de php.net website:
>
><?php
>// get a web page into an array and print it out
>$fcontents = file ('http://www.php.net');
>while (list ($line_num, $line) = each ($fcontents)) {
> echo "<b>Line $line_num:</b> " . htmlspecialchars ($line) . "<br>\n";
>}
>// get a web page into a string
>$fcontents = join ('', file ('http://www.php.net'));
>?>
>
>When I'm trying to run this code I get the following errors:
>
>Warning: php_hostconnect: connect failed in C:\Program Files\Apache
>Group\Apache\htdocs/source/screener.php on line 17
>
>Warning: file("http://www.php.net") - Bad file descriptor in C:\Program
>Files\Apache Group\Apache\htdocs/source/screener.php on line 17
>
>Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program
>Files\Apache Group\Apache\htdocs/source/screener.php on line 17
>
>
>
>What does this mean? Is it a configuration problem?
>When I try this code with some local file it works very well.
>I'm a windows user.
>
>
>
>
>
>
>
>
--
PHP Install Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]