[PHP-DEV] PHP 4.0 Bug #8552 Updated: fopen doesn't open URL From: mike <email protected>
Date: 01/04/01

ID: 8552
User Update by: mike <email protected>
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 <email protected>
$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

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: php-dev-unsubscribe <email protected>
For additional commands, e-mail: php-dev-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>