PHP 4.0 Bug #8552 Updated: fopen doesn't open URL
| From: | mike at newfangled dot com | Date: | Thu, 04 Jan 2001 16:56:31 +0000 |
| Subject: | PHP 4.0 Bug #8552 Updated: fopen doesn't open URL | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-42949@lists.php.net to get a copy of this message | ||
ID: 8552
User Update by: mike@newfangled.com
Status: Open
Bug Type: Filesystem function related
Description: fopen doesn't open URL
Here's an example of something that works and doesn't work
==============================================
function GetWebPage( $url, $maxsize=1000000 )
{
// Open a connection to the site
$fp = fopen ($url, "r");
// Did we find it?
if (!$fp)
{
// Nope, return nothing
return "";
}
// Get the page
$webpage = fread($fp, $maxsize);
// Close the connection
fclose( $fp );
return $webpage;
}
// Doesn't work get error
print GetWebPage("http://ir.stockmaster.com/c/pbn/stocks.html");
// It Works
print GetWebPage("http://www.phpbuilder.com/columns/");
=========================================
// first GetWebPage fails
//
Warning: fopen("http://ir.stockmaster.com/c/pbn/stocks.html","r")
- No error in D:\extranet\WebTop\site\t.php on line 25
Previous Comments:
---------------------------------------------------------------------------
[2001-01-04 11:35:14] mike@newfangled.com
$fp = fopen("http://ir.stockmaster.com/c/pbn/stocks.html","r");
Get "no such file".
Works perfect in php 3.0.16
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=8552