<?php

require_once 'common.php';

//检测WEB_URL
$thisurl = $_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'];
$urlarray = explode('/', $thisurl);
$urlarraysize = count($urlarray);
unset($urlarray[$urlarraysize-1]);
unset($urlarray[$urlarraysize-2]);
$weburl = '';
foreach($urlarray as $v){
	$weburl .= $v.'/';
}
$weburl = 'http://'.$weburl;
$weburl = substr($weburl, 0, -1);

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ZTJMessage 安装程序</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/script.js"></script>
</head>

<body>

<div class="box">

<div id="header">
<img src="images/logo.png" /><span>版本：3.5 Beta</span>
</div>

<div id="loac">
1.运行环境检测
&raquo;
<b style="color:#F00; font-size:24px;">2.系统设置</b>
&raquo;
3.安装数据库
&raquo;
4.设置管理员账号
&raquo;
5.完成安装
</div>

<div class="systemset">
<form action="importsql.php" method="post">
  <table width="100%" border="0">
    <tr>
      <td width="23%" height="30" align="right">&nbsp;</td>
      <td width="29%" height="30">&nbsp;</td>
      <td width="48%" height="30">&nbsp;</td>
    </tr>
    <tr>
      <td height="30" align="right">数据库服务器：</td>
      <td height="30"><label for="dbhost"></label>
        <input name="dbhost" type="text" id="textfield" value="localhost" /></td>
      <td height="30"><div class="text">一般为&ldquo;localhost&rdquo;或&ldquo;127.0.0.1&rdquo;，无须修改</div></td>
    </tr>
    <tr>
      <td height="30" align="right">数据库名：</td>
      <td height="30"><label for="dbname"></label>
        <input type="text" name="dbname" id="textfield2" /></td>
      <td height="30">&nbsp;</td>
    </tr>
    <tr>
      <td height="30" align="right">数据库用户名：</td>
      <td height="30"><label for="dbuser"></label>
        <input type="text" name="dbuser" id="textfield3" /></td>
      <td height="30">&nbsp;</td>
    </tr>
    <tr>
      <td height="30" align="right">数据库密码：</td>
      <td height="30"><label for="dbpw"></label>
        <input type="text" name="dbpw" id="textfield4" /></td>
      <td height="30">&nbsp;</td>
    </tr>
    <tr>
      <td height="30" align="right">表名前缀：</td>
      <td height="30"><label for="tabpre"></label>
        <input type="text" name="tabpre" id="textfield5" value="gbook_" /></td>
      <td height="30"><div class="text">一个数据库安装多个留言板时，请修改表名前缀</div></td>
    </tr>    
    <tr>
      <td height="30" align="right">程序安装路径：</td>
      <td height="30"><label for="weburl"></label>
        <input type="text" name="weburl" id="textfield6" value="<?php echo $weburl; ?>" /></td>
      <td height="30"><div class="text">程序自动检测，一般不用修改，若需修改，请注意结尾不能加"/"</div></td>
    </tr>
    <tr>
      <td height="30" align="right">&nbsp;</td>
      <td height="30"><input type="submit" name="NextButton" id="button" value="下一步" /></td>
      <td height="30">&nbsp;</td>
    </tr>
    <tr>
      <td height="30" align="right">&nbsp;</td>
      <td height="30">&nbsp;</td>
      <td height="30">&nbsp;</td>
    </tr>
  </table>
</form>  
</div>

</div>

</body>

</html>
