Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.39 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <meta http-equiv="content-type" content="text/html;charset=utf-8">
  4.         <link rel="stylesheet" type="text/css" href="verticleb.css">
  5.         <title>Put site name here.</title>
  6.     </head>
  7.     <?php
  8. require "samp_query.php";
  9.  
  10. $serverIP = "178.63.52.144";
  11. $serverPort = 7777;
  12.  
  13. try
  14. {
  15.     $rQuery = new QueryServer( $serverIP, $serverPort );
  16.  
  17.     $aInformation = $rQuery->GetInfo( );
  18.     $aServerRules = $rQuery->GetRules( );
  19.     $aBasicPlayer = $rQuery->GetPlayers( );
  20.     $aTotalPlayers = $rQuery->GetDetailedPlayers( );
  21.  
  22.     $rQuery->Close( );
  23. }
  24. catch (QueryServerException $pError)
  25. {
  26.     echo 'Server is offline';
  27. }
  28.  
  29. if(isset($aInformation) && is_array($aInformation)){
  30. ?>
  31. <body>
  32. <div id="boxwrap">
  33.     <div id="header">
  34.         <?php echo htmlentities($aInformation['Hostname']); ?>
  35.     </div>
  36.     <div id="content">
  37.         Server IP: <?php echo $serverIP ?>:<?php echo $serverPort ?> <br>
  38.         Players: <?php echo $aInformation['Players']; ?> / <?php echo $aInformation['MaxPlayers']; ?> <br>
  39.         Server Status: Server Stats...<br>
  40.         Gamemode: <?php echo htmlentities($aInformation['Gamemode']); ?><br>
  41.         <hr>
  42.         <u>Online Players:</u><br>
  43. <table width="200" border="0" align="left">
  44. <tr>
  45. <td><span class="scrollArea">
  46.     <b>
  47.    <?php
  48.       foreach($aTotalPlayers AS $id => $value){
  49.       ?>
  50.           <?php echo nl2br($value['Nickname']); ?>
  51. <br />
  52.    
  53.       <?php
  54.       }
  55.    
  56.       echo '</table></span>';
  57.       }
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement