ziomal432 Posted October 30, 2010 Share Posted October 30, 2010 I am writing an MTA query script, and I've read this topic: http://forum.game-monitor.com/showthread.php?t=821 but written there doesn't work (probably it works only in PHP 4). I rewrote this: <?php $ip = '87.238.175.150'; //example server $port = '22003'; $socket = fsockopen('udp://' . $ip, $port, $errno, $errstr); socket_set_timeout($socket, 1, 0); if($socket) { echo 'Connected.'; fwrite($socket, 's'); $data = fread($socket, 16384); fclose($socket); echo $data; } else echo 'Can\\'t connect.'; ?> it connects to server, but $data variable is empty string. Why? How to make it work? Link to comment
dzek (varez) Posted October 30, 2010 Share Posted October 30, 2010 Looks like it's just outdated (strange, query string didn't changed, probably response handling is different). (probably it works only in PHP 4). And PHP 4 doesn't support OOP, so it actually work only for PHP5 Solution: http://callofdutystats.net/ Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now