<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" href="install.css" type="text/css" />
<title>程序安装——FFS</title>
</head>

<body>
<h1 id="logo"><img alt="FFS" src="../images/logo.gif" /></h1>
<?php
if($_POST['submit'])
{
$config['sitename']=trim($_POST['sitename']);
$config['keywords']='免费网盘，无限容量网盘，超快速分享，FFS';
$config['description']='国内领先的在线存储服务商，快速稳定功能强大。不用注册即可上传，5秒钟完成文件分享！';
$config['beian']='京123456';
$config['url']=trim($_POST['url']);
$config['qq']='';
$config['email']='admin@fps88.com';
$config['phone']='';
$config['forsearch']='1';
$config['forsearchfile']='forsearch';
$config['tongji']='';
$config['upmax']='5';
$config['upsize']='20';
$config['uptype']='*.*';
$config['speed']='100';
$config['ad']='[FFS4]';
$config['lentime']='30';
$config['username']=trim($_POST['username']);
//$password=trim($_POST['password']);
$config['password']=substr(md5(trim($_POST['password'])),4);
@ $fpa=fopen("../data/admin.php",'w');
$contenta='$config[\'username\']=\''.$config['username']."';\n".'$config[\'password\']=\''.$config['password'].'\';';
fwrite($fpa,"<?php \n//网站管理信息 \n");
fwrite($fpa,$contenta);
fwrite($fpa,"\n?>");
fclose($fpa);

unset($config['username'],$config['password']);

@ $fpb=fopen("../data/config.php",'w');
	fwrite($fpb,"<?php \n//网站配置信息 \n");
	foreach($config as $key=> $value){
		$content='$config[\''.$key.'\']=\''.addslashes($value)."';\n";
		fwrite($fpb,$content,strlen($content));
		}
	fwrite($fpb,"\n?>");
	fclose($fpb);

$file = 'face_index.php';
$newfile='../index.php';
}
if (copy($file, $newfile)) {
?>
<p style="text-align:center">网站配置完成，其他相关配置请前往 <a href="../page/g_login.php">后台管理</a> 修改，或前往 <a href="../index.php">前台页面</a> 查看站点</p>
<?php	
	}
	else
	{
?>
<p>配置文件无法生成，请检查填写内容既相关权限。</p>
<?php
	}
?>
<p></p>
</body>
</html>
