Jump to content
Old threads will finally start getting archived ×

dazholmes

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by dazholmes

  1. this is the data i get below, i want to display each array singly into the table like gq_address which is the ip then gq_hostname which is server name then players i had this before but lost all my files years ago just trying to recreate my old server page from 2016 xD Array ( [46.105.73.18:27015] => Array ( [gq_address] => 46.105.73.18 [gq_dedicated] => [gq_gametype] => [gq_hostname] => [gq_joinlink] => steam://connect/46.105.73.18:27015/ [gq_mapname] => [gq_maxplayers] => [gq_mod] => [gq_name] => Counter-Strike: Source [gq_numplayers] => [gq_online] => [gq_password] => [gq_port_client] => 27015 [gq_port_query] => 27015 [gq_protocol] => source [gq_transport] => udp [gq_type] => css [players] => Array ( ) [teams] => Array ( ) ) ) image of the table obv bugged due to php error but i'd like to display the info to the table horizontally image the erorr is Fatal error: Uncaught Error: Undefined constant "gq_gametype" in E:\xampp\htdocs\test.php:44 Stack trace: #0 {main} thrown in E:\xampp\htdocs\test.php on line 44 line 44 <td> <?php echo $results[gq_gametype]; ?> </td>
  2. hi im trying to make a game server page. i have found gameq files which does all the hard work i have it working and printing raw data to the page but i'd like to print them into a table this is what i have so far and it doesn't work if anyone could help id appreciate it. <?php require_once('GameQ/Autoloader.php'); $GameQ = new \GameQ\GameQ(); $GameQ->addServer([ 'type' => 'css', 'host' => '46.105.73.18:27015', ]); $results = $GameQ->process(); print_r($results); ?> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <meta name="description" content="" /> <meta name="author" content="" /> <title>Defcon Gaming</title> <link rel="icon" type="image/x-icon" href="assets/favicon.ico" /> <!-- Font Awesome icons (free version)--> <script src="https://use.fontawesome.com/releases/v6.3.0/js/all.js" crossorigin="anonymous"></script> <!-- Google fonts--> <link href="https://fonts.googleapis.com/css?family=Varela+Round" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet" /> <!-- Core theme CSS (includes Bootstrap)--> <link href="css/styles.css" rel="stylesheet" /> </head> <table class="table table-striped table-dark"> <thead> <tr> <th scope="col">List</th> <th scope="col">Address</th> <th scope="col">Game Type</th> <th scope="col">Server Name</th> <th scope="col">Players</th> </tr> </thead> <tbody> <tr> <th scope="row">1</th> <td>List</td> <td> <?php echo $results[gq_gametype]; ?> </td> <!-- how can i print the veriable to this table--> <td> <?php echo $results[gq_hostname]; ?> </td><!-- how can i print the veriable to this table--> <td> <?php echo $results[players]; ?> </td><!-- how can i print the veriable to this table--> </tr> </tr> </tbody> </table> </html> what am i doing wrong with this code?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.