<!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" />
	<meta http-equiv="pragma" content="no-cache" />
	<title>sinsiu B2C 1.0 beta7 安装</title>
</head>
<body>
<?php
include('common.php');
	
$admin_name = post('admin_name');
$admin_pwd = post('admin_pwd');
$r_pwd = post('r_pwd');
$email = post('email');
$insert_en = post('insert_en');
	
if($admin_name == ''){echo '后台帐号不能为空';exit();}
if($admin_pwd == ''){echo '后台密码不能为空';exit();}
if($admin_pwd != $r_pwd){echo '两次输入密码不一致';exit();}
	
$server_url = 'http://yun.sinsiu.net/';
	
global $global;
$global['url'] = $_SERVER['PHP_SELF'];
$material = get_material('','install');
$website_id = https_request($server_url.'index.php',$material);
	
if(strlen($website_id) != 32)
{
	echo '访问服务器失败!<br />';
	echo $website_id;
	exit();
}
	
//创建配置文件
$str = file_get_contents('config.php');
$str = str_replace("\$config['S_WEBSITE_ID'] = '';","\$config['S_WEBSITE_ID'] = '".$website_id."';",$str);
$str = str_replace("\$config['S_SERVER_URL'] = '';","\$config['S_SERVER_URL'] = '".$server_url."';",$str);
file_put_contents('../include/config.php',$str);
	
//替换首页
copy('index_website.php','../index.php');
?>
安装成功，为了避免留下安全隐患，<a href="del.php">请点击这里删除安装文件</a>
</body>
</html>