Warning: Fread() [function.fread]: Length Parameter Must Be Greater Than 0

Mobile
feeds
Welcome Login | Register

Warning: Fread() [function.fread]: Length Parameter Must Be Greater Than 0
  Forums Index
      » PHP Forums
        » » Warning: fread() [function.fread]: Length parameter must be greater than 0



Warning: Fread() [function.fread]: Length Parameter Must Be Greater Than 0
Post Description:
Post Tags: warning, fread, functionfread, length, parameter, must, be, greater, than, 0, free php support, php scripts, php questions, php answers, programming, codes, scripts
This Post Has Been Viewed 2023 Times Since Sun Jan 20, 2008 5:44 pm Posted By luis with 5 replies
Warning: Fread() [function.fread]: Length Parameter Must Be Greater Than 0
i was wondering if you know any how to fix this error im getting:

Warning: fread() [function.fread]: Length parameter must be greater than 0. in myscript.php on line 65


i never seen this before how can i solve this

thanks


Leave Your Comments






Share
URL:
You can use this HTML code to put it on your website to show your friends this wallpaper. Use this code on your profile like myspace, friendster, Facebook or others. Just Copy and Paste it in your HTML on your websites



Fourms BBCODE:
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on your Posts and Replies on your forums





Comments and replies About Warning: Fread() [function.fread]: Length Parameter Must Be Greater Than 0




:: 1 :: Reply #37430 Reply By hostman On Sun Jan 20, 2008 5:58 pm
give me example of your code near the line of the error
:: 2 :: Reply #37431 Reply By luis On Sun Jan 20, 2008 5:59 pm
PHP CODE:

line 62: if ($page_type == "F") {
line 63: $filename = "../pages/".$page_url.".php";
line 64: $handle = fopen($filename, "r");
line 65: $page_content = fread($handle, filesize($filename));
line 66: fclose($handle);
:: 3 :: Reply #38260 Reply By noname On Sat Jan 26, 2008 6:54 am
line 62: if ($page_type == "f") {
line 63: $filename = "../pages/".$page_url.".php";
line 64: $handle = fopen($filename, "r");
if (filesize($filename))==0{}
else{$page_content = fread($handle, filesize($filename));}
line 66: fclose($handle);

:: 4 :: Reply #38264 Reply By test On Sat Jan 26, 2008 6:57 am
line 62: if ($page_type == "f") {
line 63: $filename = "../pages/".$page_url.".php";
line 64: $handle = fopen($filename, "r");
if (filesize($filename))==0{}
else{$page_content = fread($handle, filesize($filename));}
line 66: fclose($handle);


just use if funtion to step over it!
make it ez man
:: 5 :: Reply #38265 Reply By test On Sat Jan 26, 2008 7:01 am
another way

+ $size = filesize($filename);
+ if ( empty($size) ) {
+ return false;
+ }

just use if funtion to step over it!
make it ez man