PDA

View Full Version : Warning: fread(): Length parameter must be greater than 0


Pixelate
05-31-2006, 12:35 AM
http://developdesign.com/samples/modelagency/

How do I get rid of this error msg?

Warning: fread(): Length parameter must be greater than 0. in /home/developd/public_html/samples/modelagency/includes/templates.inc.php on line 612

templates.inc.php code

spits out file contents
\private
*/
function read_file($filename)
{
$filename = $this->root . $filename;

if (!file_exists($filename))
$this->error("phemplate::read_file(): file $filename does not exist.", 'fatal');

$tmp = fread($fp = fopen($filename, 'r'), filesize($filename));
fclose($fp);
return $tmp;
}



/*!

lavinpj1
05-31-2006, 12:37 AM
If it reads the file ok, then you can just put an @ before your fread function.

~Phil~

Pixelate
05-31-2006, 01:23 AM
It works now, thank you so much!

lavinpj1
05-31-2006, 01:50 AM
Welcome :)