Check the value of filesize($fileName).  It's probably not working - either
because PHP doesn't support it with URLs (likely) or that it's can't get the
length from the webserver (less likely).

PS: don't cross-post this sort of message to php-dev. That's for people
developing PHP, not developing *in* PHP.

----- Original Message -----
From: "CC Zona" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Saturday, September 22, 2001 4:32 PM
Subject: [PHP-DEV] Re: fopen, fread


> In article <[EMAIL PROTECTED]>,
>  [EMAIL PROTECTED] (Dries Plessers) wrote:
>
> > Can anybody tell me what is wrong.  $file contains nothing ?????
>
> > $fileName="http://www.proxis.com";;
> > $fp=fopen($fileName, "r");
> > $file=fread($fp, filesize($fileName));
> > fclose($fp);
> > print("$file");
>
> Not a good idea to just assume that every fopen will be successful (and
> therefore go ahead with the read) or that every fread will be successful
> (and therefore go ahead with the print).  Throw some error checking in
> there, and PHP will likely tell you where the code is failing and why.
>
> --
> CC
>
> --
> PHP Development 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]
>


-- 
PHP General 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]

Reply via email to