Sorry for being a complete newbie
A nice simple one for you. I dabble in different languages, and am working on a PHP project to help people running L2J servers to administer the game. My work is free to the community.
I'm having a problem, however, with code that is passing two variables by reference. I understand what I am doing, and I understand the error, which is that passing variables by reference is depreciated in the later versions of PHP. I just don't know enough to be confident of my solution.
Although setting the variable in the php.ini file will get around it, and I do set a temporary session variable, this isn't an ideal solution. Also, although fumbling around in the dark is my prefered way of learning, when other people are using my code I sort of owe it to them to say, "I need help!" and then go get it ... hence I'm here.
$usetelnet = fsockopen($telnet_host, $telnet_port, &$errno, &$errstr, $telnet_timeout);This is what I'm doing wrong ... $errno and $errstr are being passed by reference, but if I don't pass them by reference I'm sort of stuffed.
To my amateure mind, the other side is probably working on the reference and if I don't pass the right numbers, then it may well write in to an unknown place in memory. That is why I'm concerned.
If I do something like ...
$errnoref = &$errno; $errstrref = &$errstr; $usetelnet = fsockopen($telnet_host, $telnet_port, $errnoref, $errstrref, $telnet_timeout);... will that solve my problem; or will I just crash someones server!
Any help gratefully appreciated.