Jump to content
  • 0

Help with simple php server status script?


michaelsoftman

Question


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  410
  • Reputation:   29
  • Joined:  04/04/12
  • Last Seen:  

I found this code for a simple server status window online, but I can't get it to work.  I'm not very familiar with PHP, could someone take a look at it?

 

It doesn't display correctly, even after putting in my server IP.  It starts displaying all the code after "Group->Server->attributes()->loginServer ? "ONLINE" :" as text.

 

 <?php $status= simplexml_load_string(file_get_contents("http://SERVERIPHERE/?module=server&action=status-xml"));
echo "Login Server: " . ($status->Group->Server->attributes()->loginServer ? "ONLINE" : "Offline"); echo "<br>";
echo "Char Server: " . ($status->Group->Server->attributes()->charServer ? "ONLINE" : "Offline"); echo "<br>";
echo "Map Server: " . ($status->Group->Server->attributes()->mapServer ? "ONLINE" : "Offline"); echo "<br>";
echo "Players Online: " . $status->Group->Server->attributes()->playersOnline;
?>

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  135
  • Reputation:   13
  • Joined:  06/20/12
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  48
  • Topics Per Day:  0.01
  • Content Count:  410
  • Reputation:   29
  • Joined:  04/04/12
  • Last Seen:  

 

Would you happen to have a copy of the eathena one saved?  All of the download links are broken or inaccessible, even the one attached to the board.

Link to comment
Share on other sites

×
×
  • Create New...