Jump to content

Script Error


wiseguy

Recommended Posts

I have a topsites script that is displaying an error after moving to a new web host. The error reads:
[code]Warning: fread() [function.fread]: Length parameter must be greater than 0. in /home/karaoket/public_html/top-karaoke-sites/admin/lib/class.functions.php on line 723[/code]

Any ideas on what would cause this?
Link to comment
Share on other sites

just as ronald said, wrong second parameter.  my guess is that you're leaving it out:

[quote]string fread ( resource handle, int length )[/quote]

from the php manual - note that the second parameter is NOT optional.  this is usually what an fread() should look like:

$contents = fread($handle, [b]filesize('file name here')[/b]);
Link to comment
Share on other sites

[quote author=Daniel0 link=topic=109070.msg439439#msg439439 date=1158937117]
You could just change it to: [code]function get_file($url,$read='r') {
$a = fread(fopen($url, $read));
return $a;[/code]

The filesize thing just gets the total filesize, but fread will by default read everything, so you do not need that.
[/quote]

That just produced another error
[code]Warning: Wrong parameter count for fread() in /home/karaoket/public_html/top-karaoke-sites/admin/lib/class.functions.php on line 723[/code]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.