MyBB Community Forums

Full Version: Make php land in a table
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How can I make this land in a table?
It just lands over my header or under my footer. I want it in a table in the center of the site.
<?php

define('IN_MYBB', 1); require "./global.php";

add_breadcrumb("Servrar", "servrar.php");

eval("\$html = \"".$templates->get("servrar")."\";");



// Replace XXXXXX by your server id on Trackyserver.com
$server_id = "1683849";

// Execute curl and get server informations
$url="https://api.trackyserver.com/widget/index.php?id=".$server_id;
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL,$url);
$result=json_decode(curl_exec($ch), true);
curl_close($ch);

if ($result){
  // Example to print playerscount
  echo $result['playerscount'];
  echo $result['map'];  
  // Example to loop players list  
  foreach ($result['playerslist'] as $player){  
    echo $player['name'];  
  }  
  // Use print_r($result); to print all informations array  
} else {
  echo "server not found";
}

output_page($html);
?>