Location: PHPKode > projects > Quick Guestbook > quicktalk/install/qtg_setup_1.php
<?php

// QuickTalk 2.5 build:20100731

session_start();
$strV = '2.5';

if ( isset($_GET['language']) ) $_SESSION['qtg_setup_lang']=$_GET['language'];
if ( !isset($_SESSION['qtg_setup_lang']) ) $_SESSION['qtg_setup_lang']='en';
if ( !isset($_SESSION['qtg_setup_mail']) ) $_SESSION['qtg_setup_mail']='';
if ( !file_exists('qtg_lang_'.$_SESSION['qtg_setup_lang'].'.php') ) $_SESSION['qtg_setup_lang']='en';

include('qtg_lang_'.$_SESSION['qtg_setup_lang'].'.php');
include('../bin/config.php');
if ( !isset($_SESSION['qtg_dbsystem']) ) $_SESSION['qtg_dbsystem']=$qtg_dbsystem;

$strAppl = 'QuickTalk guestbook '.$strV;
$error = '';

// --------
// HTML START
// --------

include('qtg_setup_hd.php');

echo '
<table cellspacing="0">
<tr valign="top">
<td width="475" style="padding:0px">';

// --------
// SUBMITTED
// --------

if ( isset($_POST['ok']) )
{
  include('../bin/qt_lib_txt.php');

  $_SESSION['qtg_setup_mail'] = strip_tags(trim($_POST['mail']));
  $_SESSION['qtg_dbsystem'] = strip_tags(trim($_POST['qtg_dbsystem']));

  // check file system
  
  if ( $_SESSION['qtg_dbsystem']=='file')
  {
    if ( empty($error) ) { if ( !file_exists('../data') ) $error=$L['E_dir_data']; }
    if ( empty($error) ) { if ( !is_dir('../data') ) $error=$L['E_dir_data']; }
    if ( empty($error) ) { if ( !is_writable('../data') ) $error=$L['E_dir_writable']; }
  }

  // check email
  
  if ( !empty($_SESSION['qtg_setup_mail']) )
  {
    if ( empty($error) ) { if ( !QTismail($_SESSION['qtg_setup_mail']) ) $error=$L['E_email']; }
  }
  
  
  // report
  
  if ( empty($error) )
  {
  echo '<div class="setup_ok">',$L['S_save'],'</div>';
  }
  else
  {
  echo '<div class="setup_err">',$error,'</div>';
  }

}

//--

echo '<form method="post" name="install" action="qtg_setup_1.php">
<h2>',$L['Board_email'],'</h2>
<p>E-mail <input name="mail" value="',$_SESSION['qtg_setup_mail'],'" size="34" maxlength="100"/></p>
<h2>',$L['Repository'],'</h2>
<p>',$L['Select_repository'],' <select name="qtg_dbsystem">
<option value="file"',($_SESSION['qtg_dbsystem']=='file' ? ' selected="selected"' : ''),'>',$L['File_directory'],'</option>
<option value="mysql"',($_SESSION['qtg_dbsystem']!='file' ? ' selected="selected"' : ''),'>',$L['Database'],'</option>
</select> <input type="submit" name="ok" value="',$L['Save'],'"/></p>
<br/>
</form>
';

echo '
</td>
<td class="hidden"><div class="setup_help">',$L['Help_0'],'</div></td>
</tr>
</table>
';

// --------
// HTML END
// --------

$strPrevUrl = 'qtg_setup.php';
$strNextUrl = 'qtg_setup_1_db.php'; if ( $_SESSION['qtg_dbsystem']=='file' ) $strNextUrl = 'qtg_setup_1_txt.php';
$strPrevLabel= $L['Back'];
$strNextLabel= $L['Next'];

include('qtg_setup_ft.php');

?>
Return current item: Quick Guestbook