Location: PHPKode > projects > WebETB > install/install_check.php4
<?
/******************************************************************************/
/*	MODUL:	install/install_check.php4														*/
/*																										*/
/* DATUM:	27.03.2006, Version 0.1															*/
/* BESCHR.:	Pruefen der notwendigen Serverumgebung fuer die Installation 		*/
/*																										*/
/*	AUTOR:   Marcus Groh																			*/
/*	LIZENZ:  GPL v2 vom Juni 1991 															*/
/*																										*/
/*	AENDERUNGEN:	20.07.2005        -initiale Version								   */
/*                27.03.2006 v 0.1, -Versionskennzeichnung eingefuehrt        */
/*                                  -Code unter GPL v2 gestellt               */
/*																										*/
/******************************************************************************/
include ('./header.php4');
$self = basename ($PHP_SELF);

if (!isset($db_is_checked))
{
   $db_is_checked="";   }
   
// CHECK DB-Connection
  if (isset($check_db))
  {

     // get db-settings from form
     $database["password"]=$db_passwd;
     $database["user"]=$db_uname;
     $database["host"]=$db_server;
     $database["database"]=$db_dbname;
 
     // try to connect to db
     $db = mysql_connect($database["host"], $database["user"], $database["password"]);
     if ( mysql_select_db($database["database"], $db) )
     {
        $db_check_image="./good.png";
        $db_check_txt="OK";
        $db_is_checked=1;
     }
     else
     {
        $db_check_image="./bad.png";
        $db_check_txt="Fehler";
        $db_is_checked=0;
     }
     $check_db="";
  }
  else
  {
      $db_check_image="./dep.png";
      $db_check_txt="Unklar";
  }
   ?>
   <br><br>
   <center>
   <table border="0" cellspacing="0" cellpadding="0" width="550">
   <tr>
      <th colspan="5">Web-ETB Serverpr&uuml;fungen</th>
   </tr>
   <!-- BLOCK-START:    CHECK SOME PHP ENVIRONMENT-VALUES -->
   <tr>
      <td colspan="5" align="left"><p id="sw10_s">Notwendige PHP-Umgebungsvariablen:</p></td>
   </tr>
   <tr>
      <td>register_globals</td>
      <td width="20">&nbsp;</td>
      <?
      if ( ini_get('register_globals') == 1 )
      {
         echo "<td>Ein</td>\n";
         $pic="./good.png";
      }
      else
      {
         echo "<td>Aus</td>\n";
         $pic="./bad.png";      
      }
      ?>
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>
   <tr>
      <td>max_execution_time</td>
      <td width="20">&nbsp;</td>
      <?
      if ( ini_get('max_execution_time') >= 30 )
      {
         echo "<td>30 sek.</td>\n";
         $pic="./good.png";
      }
      else
      {
         echo "<td>&lt; 30 sek.</td>\n";
         $pic="./bad.png";      
      }
      ?>      
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>
   <tr>
      <td>upload_max_filesize</td>
      <td width="20">&nbsp;</td>
      <?
      if ( ini_get('upload_max_filesize') >= 6 )
      {
         echo "<td>&gt;= 6MB</td>\n";
         $pic="./good.png";
      }
      else
      {
         echo "<td>&lt; 6MB</td>\n";
         $pic="./bad.png";      
      }
      ?>      
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>   
   <tr>
      <td>display_errors</td>
      <td width="20">&nbsp;</td>
      <?
      if ( ini_get('display_errors') == 1 )
      {
         echo "<td>Ein</td>\n";
         $pic="./bad.png";
      }
      else
      {
         echo "<td>Aus</td>\n";
         $pic="./good.png";      
      }
      ?>
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>
   <tr>
      <td>magic_quotes_gpc</td>
      <td width="20">&nbsp;</td>
      <?
      if ( ini_get('magic_quotes_gpc') == 1 )
      {
         echo "<td>Ein</td>\n";
         $pic="./good.png";
      }
      else
      {
         echo "<td>Aus</td>\n";
         $pic="./bad.png";      
      }
      ?>
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>
   <tr>
      <td>session.use_trans_sid</td>
      <td width="20">&nbsp;</td>
      <?
      if ( ini_get('session.use_trans_sid') == 1 )
      {
         echo "<td>Ein</td>\n";
         $pic="./good.png";
      }
      else
      {
         echo "<td>Aus</td>\n";
         $pic="./bad.png";      
      }
      ?>
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>
   <!-- BLOCK-END:      CHECK SOME PHP ENVIRONMENT-VALUES -->
   <tr>
      <td colspan="5" height="5"></td>
   </tr>
   <!-- BLOCK-START:    CHECK SOME PHP EXTENSIONS -->
   <tr>
      <td colspan="5" align="left"><p id="sw10_s">Notwendige PHP-Erweiterungen:</p></td>
   </tr>
   <tr>
      <td>Session</td>
      <td width="20">&nbsp;</td>
      <?
      if ( extension_loaded('session') == 1 )
      {
         echo "<td>Ein</td>\n";
         $pic="./good.png";
      }
      else
      {
         echo "<td>Aus</td>\n";
         $pic="./bad.png";      
      }
      ?>
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>
   <tr>
      <td>MySQL</td>
      <td width="20">&nbsp;</td>
      <?
      if ( extension_loaded('mysql') == 1 )
      {
         echo "<td>Ein</td>\n";
         $pic = "./good.png";
         $dbcheck = 1 ;
      }
      else
      {
         echo "<td>Aus</td>\n";
         $pic = "./bad.png";
         $dbcheck = 0;
         $db_check_image="./bad.png";
         $db_check_txt="Nicht m&ouml;glich";
      }
      ?>
      <td width="20">&nbsp;</td>
      <td><img src="<? echo $pic; ?>" border="0" width="22" height="22"></td>
   </tr>
   <!-- BLOCK-END:      CHECK SOME PHP EXTENSIONS -->
   <tr>
      <td colspan="5" height="5"></td>
   </tr>
   <!-- BLOCK-START:    CHECK OTHER STUFF -->
   <tr>
      <td colspan="5" align="left"><p id="sw10_s">Zus&auml;tzliche Pr&uuml;fungen:</p></td>
   </tr>
   <tr>
      <td>Datenbankverbindung</td>
      <td width="20">&nbsp;</td>               
      <?
      if ( $dbcheck == 1 ) 
      {
         echo "<td>$db_check_txt</td>\n";         
         echo "<td width=\"20\">&nbsp;</td>\n";
         echo "<td><img src=\"$db_check_image\" border=\"0\" name=\"dbchk_state\" width=\"22\" height=\"22\"></td>\n";
         echo "</tr>\n";
         if ( $db_is_checked != 1 )
         {
         ?>
         <form action="" name="checkdb" method=post> 
         <tr>            
            <td>Benutzername: <input type=text name="db_uname"  style="border: 1px solid silver; width: 100px" value="root">&nbsp;&nbsp;&nbsp;
                Passwort:&nbsp;&nbsp;&nbsp;<input type=password name="db_passwd" style="border: 1px solid silver; width: 100px"></td>
            <td width="20">&nbsp;</td>
            <INPUT type="hidden" name="check_db" value="true">
            <td colspan="2" rowspan="2"><input type="submit" Value="Pr&uuml;fen" style="border: 1px solid silver;">
            <td>&nbsp;</td>
         </tr>
         <tr>            
            <td>Servername:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=text name="db_server" style="border: 1px solid silver; width: 100px" value="localhost">&nbsp;&nbsp;&nbsp;
                Datenbank:  <input type=text name="db_dbname" style="border: 1px solid silver; width: 100px" value="mysql"></td>
         </tr>         
         </form>
         <?
         }
      }
      else
      {
         echo "<td colspan=\"2\">$db_check_txt</td>\n";
         echo "<td><img src=\"$db_check_image\" border=\"0\" name=\"dbchk_state\" width=\"22\" height=\"22\"></td>\n";
         echo "</tr>\n";
      }
      ?>
   <!-- BLOCK-END:      CHECK OTHER STUFF -->      
   </table>
   </center>
   <?
            
include ('./footer.php4');

?>
Return current item: WebETB