|
|
Perl Quellcode |
1 2 3 4 |
<?php $var1 = include('gameq/example.php'); $var = str_replace("Uptime", " ",$var1); ?> |
|
|
PHP Quellcode |
1 |
unset($nicht_benoetigte_variable); |
|
|
PHP Quellcode |
1 |
$var = include('var'); |
|
|
PHP Quellcode |
1 |
print $var; |
|
|
PHP Quellcode |
1 2 |
$var1 = include('gameq/example.php'); // fail include 'gameq/example.php'; // well done |

|
|
PHP Quellcode |
1 |
$baem = "Hello world"; |
|
|
PHP Quellcode |
1 |
include "A.php"; $baem .= "!"; |
|
|
PHP Quellcode |
1 |
include "B.php"; echo $baem; // gibt "Hello world!" aus |
|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
<?php error_reporting(E_ALL); require_once 'GameQ.php'; // Define your servers, // see list.php for all supported games and identifiers. $servers = array( 'server 1' => array('quake3', '78.46.59.14', 27980), ); // Call the class, and add your servers. $gq = new GameQ(); $gq->addServers($servers); // You can optionally specify some settings $gq->setOption('timeout', 900); // You can optionally specify some output filters, // these will be applied to the results obtained. $gq->setFilter('normalise'); $gq->setFilter('sortplayers', 'gq_ping'); // Send requests, and parse the data $results = $gq->requestData(); // Some functions to print the results function print_results($results) { foreach ($results as $id => $data) { printf("<h2>%s</h2>\n", $id); print_table($data); } } function print_table($data) { $gqs = array('gq_online', 'gq_address', 'gq_port', 'gq_prot', 'gq_type'); if (!$data['gq_online']) { printf("<p>The server did not respond within the specified time.</p>\n"); return; } print("<table><thead><tr><td>Variable</td><td>Value</td></tr></thead><tbody>\n"); foreach ($data as $key => $val) { if (is_array($val)) continue; $cls = empty($cls) ? ' class="uneven"' : ''; if (substr($key, 0, 3) == 'gq_') { $kcls = (in_array($key, $gqs)) ? 'always' : 'normalise'; $key = sprintf("<span class=\"key-%s\">%s</span>", $kcls, $key); } printf("<tr%s><td>%s</td><td>%s</td></tr>\n", $cls, $key, $val); } print("</tbody></table>\n"); } ?> <?php print_results($results); ?> |
Quoted
server 1
Variable Value
EnhancedMod 1.0.7
P 22333333332133312333333332313332333333233333333211211121111-122
balancedteams 1
clients 0
friendlyFire 0
g_alliedmaxlives 0
g_antilag 1
g_axismaxlives 0
g_balancedteams 1
g_bluelimbotime 12000
g_friendlyFire 0
g_gametype 2
g_heavyWeaponRestriction 100
g_maxlives 0
g_minGameClients 8
g_needpass 0
g_redlimbotime 15000
g_voteFlags 0
game jaymod
gamename et
gametype 2
gq_address 78.46.59.14
gq_dedicated
gq_gametype 2
gq_hostname ^3BEGINNERS XP SAVE - STOCK MAPS
gq_mapname fueldump
gq_maxplayers 64
gq_mod jaymod
gq_numplayers 62
gq_online 1
gq_password 0
gq_port 27980
gq_prot quake3
gq_type quake3
hostname ^3BEGINNERS XP SAVE - STOCK MAPS
mapname fueldump
maxlives 0
mod_binary linux-release
mod_url http://jaymod.clanfu.org
mod_version 2.1.7
needpass 0
omnibot_enable 1
omnibot_playing 0
protocol 82
punkbuster 1
pure 1
serverload 36
sv_allowAnonymous 0
sv_cpu Intel(R) Core(TM) i7 CPU
sv_floodProtect 1
sv_hostname ^3BEGINNERS XP SAVE - STOCK MAPS
sv_maxPing 0
sv_maxRate 45000
sv_maxclients 64
sv_minPing 0
sv_minguidage 0
sv_privateClients 0
sv_punkbuster 1
sv_uptime 02d09h16m
timelimit 30
version ET
voteFlags 507903
weaprestrict 100
Die werden schon entfernt, dein Problem ist nur vermutlich, dass diese example.php zu erst die Ausgabe macht und du hinterher bestimmte Sachen in der Ausgabe entfernen willst - das geht natürlich nicht mehr. Du musst erst entfernen und dann die print_results Funktion ausführen.
|
|
PHP Quellcode |
1 2 3 |
<?php include ('gameq/example.php'); ?> <?php unset($results['sv_cpu']); ?> <?php print_results($['gq_address']); ?> |
|
|
PHP Quellcode |
1 2 3 |
<?php include ('gameq/example.php'); ?> <?php unset($data['sv_cpu']); ?> <?php print_results($['gq_address']); ?> |
Quoted
Notice: Undefined variable: results oder data in C:\xampp\htdocs\koks\sidebar.php on line 25
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\koks\gameq\example.php on line 40
|
|
PHP Quellcode |
1 2 3 4 5 |
<?php include ('gameq/example.php'); unset($results['sv_cpu']); ?> print_results($results); ?> |
die ausgabe liefert nach wie vor
Quoted
server 1
Variable Value
EnhancedMod 1.0.7
P 23333313312333333121333212323333131333333122211221211-2-11212122
balancedteams 1
clients 0
friendlyFire 0
g_alliedmaxlives 0
g_antilag 1
g_axismaxlives 0
g_balancedteams 1
g_bluelimbotime 12000
g_friendlyFire 0
g_gametype 2
g_heavyWeaponRestriction 100
g_maxlives 0
g_minGameClients 8
g_needpass 0
g_redlimbotime 15000
g_voteFlags 0
game jaymod
gamename et
gametype 2
gq_address 78.46.59.14
gq_dedicated
gq_gametype 2
gq_hostname ^3BEGINNERS XP SAVE - STOCK MAPS
gq_mapname goldrush
gq_maxplayers 64
gq_mod jaymod
gq_numplayers 62
gq_online 1
gq_password 0
gq_port 27980
gq_prot quake3
gq_type quake3
hostname ^3BEGINNERS XP SAVE - STOCK MAPS
mapname goldrush
maxlives 0
mod_binary linux-release
mod_url http://jaymod.clanfu.org
mod_version 2.1.7
needpass 0
omnibot_enable 1
omnibot_playing 0
protocol 82
punkbuster 1
pure 1
serverload 32
sv_allowAnonymous 0
sv_cpu Intel(R) Core(TM) i7 CPU
sv_floodProtect 1
sv_hostname ^3BEGINNERS XP SAVE - STOCK MAPS
sv_maxPing 0
sv_maxRate 45000
sv_maxclients 64
sv_minPing 0
sv_minguidage 0
sv_privateClients 0
sv_punkbuster 1
sv_uptime 05d09h44m
timelimit 30
version ET
voteFlags 507903
weaprestrict 100
|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
<table border="0" cellspacing="0" cellpadding="0" style="background-color:ffb665"> <tr> <td style="background-image:url(images/sub1/sub_light_orange_top_middle.png);repeat"> <img src="images/sub1/sub_light_orange_top_left_corner.png"> </td> <td width="95%" style="background-image:url(images/sub1/sub_light_orange_top_middle.png);repeat"> </td> <td style="background-image:url(images/sub1/sub_light_orange_top_middle.png);repeat"> <img src="images/sub1/sub_light_orange_top_right_corner.png"> </td> </tr> <tr> <td style="background-image:url(images/sub1/sub_light_orange_middle_left.png);background-repeat: repeat-y"> </td> <td align="left" valign="top" style="font-family:Verdana"> <font style="font-weight:bold;">Server:</font><br> <font size="-1"> <?php include ('gameq/example.php'); unset($results['sv_cpu']); print_results($results); ?> <br> <u>Shockvoice Server:</u> <? include ("include/shockvoice.php"); ?> <br /> </font> <table> <tr><td><font size="-1"> 3ster</font></td><td><img src="images/w_et_icon.png"></td> <tr><td><font size="-1"> Aro</font></td><td><img src="images/w_et_icon.png"></td> <tr><td><font size="-1"> knolle</font></td><td><img src="images/w_et_icon.png"></td> <tr><td><font size="-1"> Hooligan</font></td><td><img src="images/w_et_icon.png"><img src="images/dod_s_icon.png"><img src="images/coh_icon.png"></td> <tr><td><font size="-1"> Beffo</font></td><td><img src="images/w_et_icon.png"></td> <tr><td><font size="-1"> k0ks-kEks</font></td><td><img src="images/w_et_icon.png"><img src="images/dod_s_icon.png"><img src="images/coh_icon.png"></td> <tr><td><font size="-1"> germanAngst</font></td><td><img src="images/w_et_icon.png"><img src="images/coh_icon.png"></td> <tr><td><font size="-1"> Haudi</font></td><td><img src="images/w_et_icon.png"></td> <tr><td><font size="-1"> Prototype</font></td><td><img src="images/w_et_icon.png"></td> <tr><td><font size="-1"> Welfe</font></td><td><img src="images/dod_s_icon.png"><img src="images/coh_icon.png"></td> </table> </td> <td style="background-image:url(images/sub1/sub_light_orange_middle_right.png);background-repeat: repeat-y"> </td> </tr> <tr> <td width="32px" height="32px"> <img src="images/sub1/sub_light_orange_bottom_left_corner.png"> </td> <td width="32px" height="32px" style="background-image:url(images/sub1/sub_light_orange_bottom_middle.png);repeat"> </td> <td width="32px" height="32px"> <img src="images/sub1/sub_light_orange_bottom_right_corner.png"> </td> </tr> </table> |
|
|
PHP Quellcode |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
<?php error_reporting(E_ALL); require_once 'GameQ.php'; // Define your servers, // see list.php for all supported games and identifiers. $servers = array( 'server 1' => array('quake3', '78.46.59.14', 27980), ); // Call the class, and add your servers. $gq = new GameQ(); $gq->addServers($servers); // You can optionally specify some settings $gq->setOption('timeout', 900); // You can optionally specify some output filters, // these will be applied to the results obtained. $gq->setFilter('normalise'); $gq->setFilter('sortplayers', 'gq_ping'); // Send requests, and parse the data $results = $gq->requestData(); // Some functions to print the results function print_results($results) { foreach ($results as $id => $data) { printf("<h2>%s</h2>\n", $id); print_table($data); } } function print_table($data) { $gqs = array('gq_online', 'gq_address', 'gq_port', 'gq_prot', 'gq_type'); if (!$data['gq_online']) { printf("<p>The server did not respond within the specified time.</p>\n"); return; } print("<table><thead><tr><td>Variable</td><td>Value</td></tr></thead><tbody>\n"); foreach ($data as $key => $val) { if (is_array($val)) continue; $cls = empty($cls) ? ' class="uneven"' : ''; if (substr($key, 0, 3) == 'gq_') { $kcls = (in_array($key, $gqs)) ? 'always' : 'normalise'; $key = sprintf("<span class=\"key-%s\">%s</span>", $kcls, $key); } printf("<tr%s><td>%s</td><td>%s</td></tr>\n", $cls, $key, $val); } print("</tbody></table>\n"); } ?> |