astropirit Posted November 2, 2008 Share Posted November 2, 2008 Hello all; i am trying to make a little server stat signiture. currently i am trying to get the info from my server using php (obviously i have never done) now i started my little game server and ran WPE PRO on it, it showe that when it receives the command Line number On/Off | Expand/Contract ../status. it sends the server stats. my question is that how might one implement this in php? so far i have this: (i do not know if i am on the right track.) Line number On/Off | Expand/Contract <?php $handle = fsockopen('192.168.1.2', 3558, $erno, $errstr, 15); if (!$handle) { //if connection fails exit and tell us what went wrong. die("Connect failed:its all your falut!!!! jerk! $errstr\n"); } else { $message = "../whatmap.\n"; //read the first responds the server gives us (usually the version string) //send our data to the game server fwrite($handle, "$message"); $responses = fgets($handle, 20); /* until there is no more output to read from the smtp server keep storing all the output in the $responses variable. Once there's nothing else to read show us all the output and exit */ while (!feof($handle)) { $responses .= fgets($handle, 20); } echo "$responses"; fclose($handle); } ?> this code is from a tutorial modified by me (some what) i would greatly appreciate any help at all. Link to comment https://forums.phpfreaks.com/topic/131046-getting-server-info-using-by-sending-commands/ Share on other sites More sharing options...
astropirit Posted November 3, 2008 Author Share Posted November 3, 2008 bump. Link to comment https://forums.phpfreaks.com/topic/131046-getting-server-info-using-by-sending-commands/#findComment-680862 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.