php fread() error

Status
Not open for further replies.

nunoabc

New Member
Messages
151
Reaction score
0
Points
0
I'm having the following error:

Code:
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/nunoabc/public_html/rc/classes/rcon_hl_net.inc on line 424

I have the intermidiate level of PHP, do I need the advanced one?
 

nunoabc

New Member
Messages
151
Reaction score
0
Points
0
well i just want to solve this problem, so i need useful advices
but thanks for the information any way...
 

Xemnas

New Member
Messages
812
Reaction score
0
Points
0
The fread() length parameter must be non-zero and positive.
 
Last edited:

nunoabc

New Member
Messages
151
Reaction score
0
Points
0
yes but in the line that is giving that error (line 424) there is only this:

Code:
$buffer .= fread($this->socket, $status["unread_bytes"])

this is only variables... how do i know if it is positive, zero or negative?

does it appear on your browser?
go to http://ew.exofire.net/rc/ and see if you have this error:
Code:
Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home/nunoabc/public_html/rc/classes/rcon_hl_net.inc on line 424

BTW the error is in the top of the webpage.

edit:
i'll try to have advanced level on PHP, maybe that solves my problem
 
Last edited:

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Echo out the value of $status["unread_bytes"] chances are its not a valid value and has nothing to do with advanced PHP.
 

nunoabc

New Member
Messages
151
Reaction score
0
Points
0
i've done it and now gives me another error:

Code:
Warning: Wrong parameter count for fread() in /home/nunoabc/public_html/rc/classes/rcon_hl_net.inc on line 424

this error (i think) is kinda stupid isn't it?
 
Last edited:

Slothie

New Member
Messages
1,429
Reaction score
0
Points
0
Its probably the script, I can fread a file with no problems in intermediate php.
 

nunoabc

New Member
Messages
151
Reaction score
0
Points
0
but that isn't affecting me directly... i just want to solve this problem, so this doesn't lead to side effects, do you understand what i'm talking about?

edit:
offtopic:
i'm getting to bed because in my country it is too late (1:45 AM) and i'm only 15 : )
so only for about 8 hours i'll see this thread again! see ya
 
Last edited:

Bryon

I Fix Things
Messages
8,149
Reaction score
101
Points
48
There really is no way for us to help you with your problem without you showing us any code from your script.

And, like Slothie said, the error you're receiving is in no way caused by your account's version of PHP.
 

Xemnas

New Member
Messages
812
Reaction score
0
Points
0
There needs to be a length parameter (in bytes) in fread(). Without it fread() will return an error as the length parameter is required.
 

nunoabc

New Member
Messages
151
Reaction score
0
Points
0
thank you xemnas, and i think where is the problem.
that part of my website is a webpage that controls and monitors games servers such as Counter-Strike, Day of Defeat and Condition Zero.
the problem is solved! it only needed a server online, is IP, is port (default:27015) and his rcon (r - remote; con - control) password.

BTW how do I close the thread?!
 
Status
Not open for further replies.
Top