<?php


  $www_location = 'http://' . getenv('HTTP_HOST') . getenv('SCRIPT_NAME');
  $www_location = substr($www_location, 0, strpos($www_location, 'setup'));

  $script_filename = getenv('PATH_TRANSLATED');
  if (empty($script_filename)) {
    $script_filename = getenv('SCRIPT_FILENAME');
  }

  $script_filename = str_replace('\\', '/', $script_filename);
  $script_filename = str_replace('//', '/', $script_filename);

  $dir_fs_www_root_array = explode('/', dirname($script_filename));
  $dir_fs_www_root = array();
  for ($i=0, $n=sizeof($dir_fs_www_root_array)-1; $i<$n; $i++) {
    $dir_fs_www_root[] = $dir_fs_www_root_array[$i];
  }
  $dir_fs_www_root = implode('/', $dir_fs_www_root) . '/';
  
//////////////////////////////////

  $dir_fs_document_root = $dir_fs_www_root;
  if ((substr($dir_fs_document_root, -1) != '/') && (substr($dir_fs_document_root, -1) != '/')) {
    $where = strrpos($dir_fs_document_root, '\\');
    if (is_string($where) && !$where) {
      $dir_fs_document_root .= '/';
    } else {
      $dir_fs_document_root .= '\\';
    }
  }
?>
<p><b>Konfiguration / Configuration</b></p>

<?php
  $db = array();
  $db['DB_SERVER'] = trim(stripslashes($_POST['DB_SERVER']));
  $db['DB_SERVER_USERNAME'] = trim(stripslashes($_POST['DB_SERVER_USERNAME']));
  $db['DB_SERVER_PASSWORD'] = trim(stripslashes($_POST['DB_SERVER_PASSWORD']));
  $db['DB_DATABASE'] = trim(stripslashes($_POST['DB_DATABASE']));

  $db_error = false;
  bigware_db_connect($db['DB_SERVER'], $db['DB_SERVER_USERNAME'], $db['DB_SERVER_PASSWORD']);

  if ($db_error == false) {
    bigware_db_test_connection($db['DB_DATABASE']);
  }
@chmod ($dir_fs_document_root . 'load_this/load_this_bigware_15.php', 0777);
@chmod ($dir_fs_document_root . 'configmain/load_this/load_bigware_15.php', 0777);
@mkdir ($dir_fs_document_root . 'session', 0777);
@chmod ($dir_fs_document_root . 'session', 0777);  
  if ($db_error != false) {
?>
<form name="install" action="install.php?step=6" method="post">

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td>
      <p>A test connection made to the database was <b>NOT</b> successful.<br>
	  Eine Testverbindung zur Datenbank war <b>NICHT</b> erfolgreich.</p>
      <p>The error message returned is:<br>
	  Die zurückgegebene Fehlermeldung ist:</p>
      <p class="frameme"><?php echo $db_error; ?></p>
      <p>Please click on the <i><b>Back</b></i> button below to review your database server settings.<br>
	  Bitte clicken Sie den <i><b>zurück</b></i> Button, um Ihre Servereinstellungen zu überprüfen.</p>
      <p>If you require help with your database server settings, please consult your hosting company.<br>
	  Sofern Sie Hilfe für Ihre Datenbankeinstellungen benötigen, empfehlen wir Ihnen sich mit Ihrem Webhosting Provider in Verbindung zu setzen.</p>
    </td>
  </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="index.php"><img src="picture/button_cancel.gif" border="0" alt="Cancel"></a></td>
    <td align="center"><input type="image" src="picture/button_back.gif" border="0" alt="Back"></td>
  </tr>
</table>

<?php
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if ($key != 'x' && $key != 'y') {
        if (is_array($value)) {
          for ($i=0; $i<sizeof($value); $i++) {
            echo bigware_fetch_hidden_field($key . '[]', $value[$i]);
          }
        } else {
          echo bigware_fetch_hidden_field($key, $value);
        }
      }
    }
?>

</form>

<?php
  } elseif ( (file_exists($dir_fs_document_root . 'load_this/load_this_bigware_15.php')) && (!is_writeable($dir_fs_document_root . 'load_this/load_this_bigware_15.php')) ) {
?>
<form name="install" action="install.php?step=7" method="post">

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td>
      <p>Der folgende Fehler ist aufgetreten</p>
      <p><div class="frameMe">
      <b>Die Konfigurationsdatei im "<font color="#0000FF">Katalogbereich</font>", in die hinein geschrieben werden sollte, existiert nicht <b>oder</b> die Ausführrechte sind nicht korrekt gesetzt.</b><br><br>Beachten Sie folgende Anweisung:<br>
      <b></b><br><br>
        <ul class="frameMe"><li>
        Gehen Sie in das Verzeichnis <?php echo $dir_fs_document_root; ?>load_this/
        </li><li>
        Gehen Sie in diesem Verzeichnis zur Datei "load_this_bigware_15.php"
        </li><li>
        Setzen Sie die Ausführrechte der datei load_this_bigware_15.php auf chmod 777
        </li></ul></div>
      </p>
    </td>
  </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="index.php"><img src="picture/button_cancel.gif" border="0" alt="Cancel"></a></td>
    <td align="center"><input type="image" src="picture/button_retry.gif" border="0" alt="Retry"></td>
  </tr>
</table>

<?php
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if ($key != 'x' && $key != 'y') {
        if (is_array($value)) {
          for ($i=0; $i<sizeof($value); $i++) {
            echo bigware_fetch_hidden_field($key . '[]', $value[$i]);
          }
        } else {
          echo bigware_fetch_hidden_field($key, $value);
        }
      }
    }
?>

</form>

<?php
  } elseif ( (file_exists($dir_fs_document_root . 'configmain/load_this/load_bigware_15.php')) && (!is_writeable($dir_fs_document_root . 'configmain/load_this/load_bigware_15.php')) ) {
?>
<form name="install" action="install.php?step=7" method="post">

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td>
      <p>Der folgende Fehler ist aufgetreten</p>
      <p><div class="frameMe">
      <b>Die Konfigurationsdatei im "<font color="#008000">Adminbereich</font>", in die hinein geschrieben werden sollte, existiert nicht <b>oder</b> die Ausführrechte sind nicht korrekt gesetzt.</b><br><br>Beachten Sie folgende Anweisung:<br>
      <b></b><br><br>
        <ul class="frameMe"><li>
        Gehen Sie in das Verzeichnis <?php echo $dir_fs_document_root; ?>configmain/load_this/
        </li><li>
        Gehen Sie in diesem Verzeichnis zur Datei "load_bigware_15.php"
        </li><li>
        Setzen Sie die Ausführrechte der Datei load_bigware_15.php auf chmod 777
        </li></ul></div>
      </p>
    </td>
  </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="index.php"><img src="picture/button_cancel.gif" border="0" alt="Cancel"></a></td>
    <td align="center"><input type="image" src="picture/button_retry.gif" border="0" alt="Retry"></td>
  </tr>
</table>

<?php
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if ($key != 'x' && $key != 'y') {
        if (is_array($value)) {
          for ($i=0; $i<sizeof($value); $i++) {
            echo bigware_fetch_hidden_field($key . '[]', $value[$i]);
          }
        } else {
          echo bigware_fetch_hidden_field($key, $value);
        }
      }
    }
?>

</form>

<?php
    
    














//----------------------------------

    }elseif(!file_exists($dir_fs_document_root . 'configmain/session')){

?>
<form name="install" action="install.php?step=7" method="post">

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td>
      <p>Der folgende Fehler ist aufgetreten</p>
      <p><div class="frameMe">
      <b>Das Verzeichnis "<font color="#800000">configmain/session</font>" existiert nicht.</b><br><br>Beachten Sie folgende Anweisung:<br>
      <b></b><br><br>
        <ul class="frameMe"><li>
        Gehen Sie in das Verzeichnis <?php echo $dir_fs_document_root; ?>configmain
        </li><li>
        Legen Sie hier ein Verzeichnis mit dem Namen "session" an.
        </li><li>
        Setzen Sie die Ausführrechte dieses Verzeichnis auf chmod 777
        </li></ul></div>
      </p>
    </td>
  </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="index.php"><img src="picture/button_cancel.gif" border="0" alt="Cancel"></a></td>
    <td align="center"><input type="image" src="picture/button_retry.gif" border="0" alt="Retry"></td>
  </tr>
</table>

<?php
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if ($key != 'x' && $key != 'y') {
        if (is_array($value)) {
          for ($i=0; $i<sizeof($value); $i++) {
            echo bigware_fetch_hidden_field($key . '[]', $value[$i]);
          }
        } else {
          echo bigware_fetch_hidden_field($key, $value);
        }
      }
    }

?>

</form>
<?php 	
   }elseif(!is_writeable($dir_fs_document_root . 'configmain/session')){

echo is_writeable($dir_fs_document_root . 'configmain/session');

?>
<form name="install" action="install.php?step=7" method="post">

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td>
      <p>Der folgende Fehler ist aufgetreten</p>
      <p><div class="frameMe">
      <b>Das Verzeichnis "configmain/session" hat nicht die nötigen Ausführrechte.</b><br><br>Beachten Sie folgende Anweisung:<br>
      <b></b><br><br>
        <ul class="frameMe"><li>
        Gehen Sie zum Verzeichnis <?php echo $dir_fs_document_root; ?>configmain/session
        </li><li>
        Setzen Sie die Ausführrechte dieses Verzeichnis auf chmod 777
        </li></ul></div>
      </p>
    </td>
  </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="index.php"><img src="picture/button_cancel.gif" border="0" alt="Cancel"></a></td>
    <td align="center"><input type="image" src="picture/button_retry.gif" border="0" alt="Retry"></td>
  </tr>
</table>

<?php
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if ($key != 'x' && $key != 'y') {
        if (is_array($value)) {
          for ($i=0; $i<sizeof($value); $i++) {
            echo bigware_fetch_hidden_field($key . '[]', $value[$i]);
          }
        } else {
          echo bigware_fetch_hidden_field($key, $value);
        }
      }
    }

?>

</form>
<?php 


//----------------------------------














    }elseif(!file_exists($dir_fs_document_root . 'session')){

?>
<form name="install" action="install.php?step=7" method="post">

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td>
      <p>Der folgende Fehler ist aufgetreten</p>
      <p><div class="frameMe">
      <b>Das Verzeichnis "<font color="#800080">session</font>" existiert nicht.</b><br><br>Beachten Sie folgende Anweisung:<br>
      <b></b><br><br>
        <ul class="frameMe"><li>
        Gehen Sie in das Verzeichnis <?php echo $dir_fs_document_root; ?>
        </li><li>
        Legen Sie hier ein Verzeichnis mit dem Namen "session" an.
        </li><li>
        Setzen Sie die Ausführrechte dieses Verzeichnis auf chmod 777
        </li></ul></div>
      </p>
    </td>
  </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="index.php"><img src="picture/button_cancel.gif" border="0" alt="Cancel"></a></td>
    <td align="center"><input type="image" src="picture/button_retry.gif" border="0" alt="Retry"></td>
  </tr>
</table>

<?php
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if ($key != 'x' && $key != 'y') {
        if (is_array($value)) {
          for ($i=0; $i<sizeof($value); $i++) {
            echo bigware_fetch_hidden_field($key . '[]', $value[$i]);
          }
        } else {
          echo bigware_fetch_hidden_field($key, $value);
        }
      }
    }

?>

</form>
<?php 	
   }elseif(!is_writeable($dir_fs_document_root . 'session')){

echo is_writeable($dir_fs_document_root . 'session');

?>
<form name="install" action="install.php?step=7" method="post">

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td>
      <p>Der folgende Fehler ist aufgetreten</p>
      <p><div class="frameMe">
      <b>Das Verzeichnis "session" hat nicht die nötigen Ausführrechte.</b><br><br>Beachten Sie folgende Anweisung:<br>
      <b></b><br><br>
        <ul class="frameMe"><li>
        Gehen Sie zum Verzeichnis <?php echo $dir_fs_document_root; ?>session
        </li><li>
        Setzen Sie die Ausführrechte dieses Verzeichnis auf chmod 777
        </li></ul></div>
      </p>
    </td>
  </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="index.php"><img src="picture/button_cancel.gif" border="0" alt="Cancel"></a></td>
    <td align="center"><input type="image" src="picture/button_retry.gif" border="0" alt="Retry"></td>
  </tr>
</table>

<?php
    reset($_POST);
    while (list($key, $value) = each($_POST)) {
      if ($key != 'x' && $key != 'y') {
        if (is_array($value)) {
          for ($i=0; $i<sizeof($value); $i++) {
            echo bigware_fetch_hidden_field($key . '[]', $value[$i]);
          }
        } else {
          echo bigware_fetch_hidden_field($key, $value);
        }
      }
    }

?>

</form>
<?php 
  } else {
    $http_url = parse_url($www_location);
    $http_server = $http_url['scheme'] . '://' . $http_url['host'];
    $http_catalog = $http_url['path'];
    if (isset($http_url['port']) && !empty($http_url['port'])) {
      $http_server .= ':' . $http_url['port'];
    }

    if (substr($http_catalog, -1) != '/') {
      $http_catalog .= '/';
    }
		
    $https_server = '';
    $https_catalog = '';
    if (isset($_POST['HTTPS_WWW_ADDRESS']) && !empty($_POST['HTTPS_WWW_ADDRESS'])) {
      $https_url = parse_url($_POST['HTTPS_WWW_ADDRESS']);
      $https_server = $https_url['scheme'] . '://' . $https_url['host'];
      $https_catalog = $https_url['path'];

      if (isset($https_url['port']) && !empty($https_url['port'])) {
        $https_server .= ':' . $https_url['port'];
      }

      if (substr($https_catalog, -1) != '/') {
        $https_catalog .= '/';
      }
    }
		
		$http_cookie_path = substr($http_catalog, 0, -1);
		if ($http_cookie_path == '') {
			$http_cookie_path = '/';
		}
		$http_cookie_domain = str_replace('http://www.', '', $http_server);
		$http_cookie_domain = str_replace('http://', '', $http_cookie_domain);
  
    $enable_ssl = (isset($_POST['ENABLE_SSL']) && ($_POST['ENABLE_SSL'] == 'true') ? 'true' : 'false');

//    $https_cookie_domain = (isset($_POST['HTTPS_COOKIE_DOMAIN']) ? $_POST['HTTPS_COOKIE_DOMAIN'] : '');
//    $http_cookie_path = $_POST['HTTP_COOKIE_PATH'];
//    $https_cookie_path = (isset($_POST['HTTPS_COOKIE_PATH']) ? $_POST['HTTPS_COOKIE_PATH'] : '');
    // shop
    $file_contents = '<?php' . "\n" .
                     '//' . "\n" .
                     '//' . "\n" .
                     '//Release Datum: 20.11.2015) ' . "\n" .
  					 '//Bigware Shop) ' . "\n" .
					 '//http://www.bigware.de) ' . "\n" .

					 '//Copyright (c) 2015 Bigware LTD) ' . "\n" .
					 '//(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)) ' . "\n" .
					 '//(c) 2015	Bigware LTD ' . "\n" .
                     '//' . "\n" .
                     '//' . "\n" .
                     '  define(\'HTTP_SERVER\', \'' . $http_server . '\');' . "\n" .
                     '  define(\'HTTPS_SERVER\', \'' . $https_server . '\');' . "\n" .
                     '  define(\'ENABLE_SSL\', ' . $enable_ssl . ');' . "\n" .
                     '  define(\'HTTP_COOKIE_DOMAIN\', \'' . $http_cookie_domain . '\');' . "\n" .
                     '  define(\'HTTPS_COOKIE_DOMAIN\', \'' . $https_cookie_domain . '\');' . "\n" .
                     '  define(\'HTTP_COOKIE_PATH\', \'' . $http_cookie_path . '\');' . "\n" .
                     '  define(\'HTTPS_COOKIE_PATH\', \'' . $https_cookie_path . '\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_HTTP_CATALOG\', \'' . $http_catalog . '\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_HTTPS_CATALOG\', \'' . $https_catalog . '\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_PICTURES\', \'picture/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_ICONS\', FOLDER_RELATIV_PICTURES . \'icons/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_INCLUDES\', \'load_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_CONTENT\', \'content/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_FUNCTIONS\', \'func_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_CLASSES\', \'class_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_MODULES\', FOLDER_RELATIV_INCLUDES . \'mods/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_LANG_MODULES_IN_LANG\', \'mods/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_LANGUAGES\', \'lang_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_DOWNLOAD_PUBLIC\', \'pub/\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_CATALOG\', \'' . $dir_fs_document_root . '\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_DOWNLOAD\', FOLDER_ABSOLUT_CATALOG . \'download/\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_DOWNLOAD_PUBLIC\', FOLDER_ABSOLUT_CATALOG . \'pub/\');' . "\n" .
                     '  define(\'DB_SERVER\', \'' . $_POST['DB_SERVER'] . '\');' . "\n" .
                     '  define(\'DB_SERVER_USERNAME\', \'' . $_POST['DB_SERVER_USERNAME'] . '\');' . "\n" .
                     '  define(\'DB_SERVER_PASSWORD\', \'' . $_POST['DB_SERVER_PASSWORD']. '\');' . "\n" .
                     '  define(\'DB_DATABASE\', \'' . $_POST['DB_DATABASE']. '\');' . "\n" .
					 '//  define(\'DB_CHARSET\', \'utf8\'); //In case of display problems of special characters pls aktivate this line and set the appropriate charset setting from your MySQL database  ' . "\n" .
                     '  define(\'USE_PCONNECT\', \'' . (($_POST['USE_PCONNECT'] == 'true') ? 'true' : 'false') . '\');' . "\n" .
                     '  define(\'SHOP_SESSIONS\', \'' . (($_POST['SHOP_SESSIONS'] == 'files') ? '' : 'mysql') . '\'); //\'\' or \'mysql\'
                     ?>';

    $fp = fopen($dir_fs_document_root . 'load_this/load_this_bigware_15.php', 'w');
    fputs($fp, $file_contents);
    fclose($fp);
    // admin
    $file_contents = '<?php' . "\n" .
                     '//' . "\n" .
                     '//' . "\n" .
                     '//Release Datum: 20.11.2015) ' . "\n" .
  					 '//Bigware Shop) ' . "\n" .
					 '//http://www.bigware.de) ' . "\n" .

					 '//Copyright (c) 2015 Bigware LTD) ' . "\n" .
					 '//(c) 2000-2001 The Exchange Project  (earlier name of osCommerce)) ' . "\n" .
					 '//(c) 2015	Bigware LTD ' . "\n" .
                     '//' . "\n" .
                     '//' . "\n" .
                     '  define(\'HTTP_SERVER\', \'' . $http_server . '\');' . "\n" .
                     '  define(\'HTTP_CATALOG_SERVER\', \'' . $http_server . '\');' . "\n" .
                     '  define(\'HTTPS_CATALOG_SERVER\', \'' . $https_server . '\');' . "\n" .
                     '  define(\'ENABLE_SSL_CATALOG\', \'' . $enable_ssl . '\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_DOCUMENT_ROOT\', \'' . $dir_fs_document_root . '\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_FORMER\', \'' . $http_catalog . 'configmain/\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_FORMER\', \'' . $dir_fs_document_root . 'configmain/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_CATALOG\', \'' . $http_catalog . '\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_CATALOG\', \'' . $dir_fs_document_root . '\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_PICTURES\', \'picture/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_ICONS\', FOLDER_RELATIV_PICTURES . \'icons/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_CATALOG_PICTURES\', FOLDER_RELATIV_CATALOG . \'picture/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_INCLUDES\', \'load_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_FUNCTIONS\', \'func_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_CLASSES\', \'class_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_MODULES\', FOLDER_RELATIV_INCLUDES . \'mods/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_LANG_MODULES_IN_LANG\', \'mods/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_LANGUAGES\', \'lang_this/\');' . "\n" .
                     '  define(\'FOLDER_RELATIV_CATALOG_LANGUAGES\', FOLDER_RELATIV_CATALOG . \'lang_this/\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_CATALOG_LANGUAGES\', FOLDER_ABSOLUT_CATALOG . \'lang_this/\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_CATALOG_PICTURES\', FOLDER_ABSOLUT_CATALOG . \'picture/\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_CATALOG_MODULES\', FOLDER_ABSOLUT_CATALOG . \'load_this/mods/\');' . "\n" .
                     '  define(\'FOLDER_ABSOLUT_BACKUP\', FOLDER_ABSOLUT_FORMER . \'backups/\');' . "\n" .
                     '  define(\'DB_SERVER\', \'' . $_POST['DB_SERVER'] . '\');' . "\n" .
                     '  define(\'DB_SERVER_USERNAME\', \'' . $_POST['DB_SERVER_USERNAME'] . '\');' . "\n" .
                     '  define(\'DB_SERVER_PASSWORD\', \'' . $_POST['DB_SERVER_PASSWORD']. '\');' . "\n" .
                     '  define(\'DB_DATABASE\', \'' . $_POST['DB_DATABASE']. '\');' . "\n" .
					 '//  define(\'DB_CHARSET\', \'utf8\'); //In case of display problems of special characters pls aktivate this line and set the appropriate charset setting from your MySQL database  ' . "\n" .
                     '  define(\'USE_PCONNECT\', \'' . (($_POST['USE_PCONNECT'] == 'true') ? 'true' : 'false') . '\');' . "\n" .
                     '  define(\'SHOP_SESSIONS\', \'' . (($_POST['SHOP_SESSIONS'] == 'files') ? '' : 'mysql') . '\'); // or \'mysql\'' . "\n" .
					 '  define(\'SESSION_TIMEOUT\', \'3600\');' . "\n" .
                     '  define(\'MASTER_SECURE\', \'0\'); // or \'1\' = Mails from the administration in "Admin => Login" or "Konfig => Mein Shop => Nachrichten" or "Konfig => Mein Shop => Bestelldetails" you can not edit
                     ?>';

    $fp = fopen($dir_fs_document_root . 'configmain/load_this/load_bigware_15.php', 'w');
    fputs($fp, $file_contents);
    fclose($fp);
?>

<table width="95%" border="0" cellpadding="2" class="formPage">
  <tr>
    <td><p>Die Konfiguration war erfolgreich!
	<p>The configuration was successfull!</p></td>
 </tr>
</table>

<p>&nbsp;</p>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><a href="<?php echo $http_server . $http_catalog . 'index.php'; ?>" target="_blank"><img src="picture/button_catalog.gif" border="0" alt="Catalog"></a></td>
    <td align="center"><a href="<?php echo $http_server . $http_catalog . 'configmain/index.php'; ?>" target="_blank"><img src="picture/button_formerarea_tool.gif" border="0" alt="Administration Tool"></a></td>
  </tr>
</table>

<?php
  }
?>
