home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / server_variables.php < prev    next >
Encoding:
PHP Script  |  2003-11-26  |  2.6 KB  |  113 lines

  1. <?php
  2. /* $Id: server_variables.php,v 2.2 2003/11/26 22:52:24 rabus Exp $ */
  3. // vim: expandtab sw=4 ts=4 sts=4:
  4.  
  5.  
  6. /**
  7.  * Does the common work
  8.  */
  9. require('./server_common.inc.php');
  10.  
  11.  
  12. /**
  13.  * Displays the links
  14.  */
  15. require('./server_links.inc.php');
  16.  
  17.  
  18. /**
  19.  * Displays the sub-page heading
  20.  */
  21. echo '<h2>' . "\n"
  22.    . '    ' . $strServerVars . "\n"
  23.    . '</h2>' . "\n";
  24.  
  25.  
  26. /**
  27.  * Checks if the user is allowed to do what he tries to...
  28.  */
  29. if (!$is_superuser && !$cfg['ShowMysqlVars']) {
  30.     echo $strNoPrivileges;
  31.     require_once('./footer.inc.php');
  32. }
  33.  
  34.  
  35. /**
  36.  * Sends the queries and buffers the results
  37.  */
  38. if (PMA_MYSQL_INT_VERSION >= 40003) {
  39.     $res = @PMA_mysql_query('SHOW SESSION VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW SESSION VARIABLES;');
  40.     while ($row = PMA_mysql_fetch_row($res)) {
  41.         $serverVars[$row[0]] = $row[1];
  42.     }
  43.     @mysql_free_result($res);
  44.     $res = @PMA_mysql_query('SHOW GLOBAL VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW GLOBAL VARIABLES;');
  45.     while ($row = PMA_mysql_fetch_row($res)) {
  46.         $serverVarsGlobal[$row[0]] = $row[1];
  47.     }
  48.     @mysql_free_result($res);
  49. } else {
  50.     $res = @PMA_mysql_query('SHOW VARIABLES;', $userlink) or PMA_mysqlDie(PMA_mysql_error($userlink), 'SHOW VARIABLES;');
  51.     while ($row = PMA_mysql_fetch_row($res)) {
  52.         $serverVars[$row[0]] = $row[1];
  53.     }
  54.     @mysql_free_result($res);
  55. }
  56. unset($res);
  57. unset($row);
  58.  
  59.  
  60. /**
  61.  * Displays the page
  62.  */
  63. ?>
  64. <table border="0">
  65.     <tr>
  66.         <th> <?php echo $strVar; ?> </th>
  67. <?php
  68. echo '        <th> ';
  69. if (PMA_MYSQL_INT_VERSION >= 40003) {
  70.     echo $strSessionValue . ' </th>' . "\n"
  71.        . '        <th> ' . $strGlobalValue;
  72. } else {
  73.     echo $strValue;
  74. }
  75. echo ' </th>' . "\n";
  76. ?>
  77.     </tr>
  78. <?php
  79. $useBgcolorOne = TRUE;
  80. foreach ($serverVars as $name => $value) {
  81. ?>
  82.     <tr>
  83.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
  84.             <?php echo htmlspecialchars(str_replace('_', ' ', $name)) . "\n"; ?>
  85.         </td>
  86.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
  87.             <?php echo htmlspecialchars($value) . "\n"; ?>
  88.         </td>
  89. <?php
  90.     if (PMA_MYSQL_INT_VERSION >= 40003) {
  91. ?>
  92.         <td bgcolor="<?php echo $useBgcolorOne ? $cfg['BgcolorOne'] : $cfg['BgcolorTwo']; ?>">
  93.             <?php echo htmlspecialchars($serverVarsGlobal[$name]) . "\n"; ?>
  94.         </td>
  95. <?php
  96.     }
  97.     $useBgcolorOne = !$useBgcolorOne;
  98. ?>
  99.     </tr>
  100. <?php
  101. }
  102. ?>
  103. </table>
  104. <?php
  105.  
  106.  
  107. /**
  108.  * Sends the footer
  109.  */
  110. require_once('./footer.inc.php');
  111.  
  112. ?>
  113.