{$msg}
EOT; if ($page == 'yes') { echo ''; } echo <<connect_error){ Msg('数据库连接失败'); } // if($mysqli->query("SHOW TABLES LIKE '" . $dbprefix . "user'")->fetch_array(MYSQLI_ASSOC) != null){ // Msg('看起来你的幻想领域已经安装过了。请先清空原有数据在进行安装!'); // } $mysqli->query("SET NAMES UTF8"); $time = time(); $password = md5($password); $sql =" CREATE TABLE `{$dbprefix}pic` ( `id` int(11) NOT NULL AUTO_INCREMENT, `pid` varchar(128) NOT NULL DEFAULT '', `uid` int(11) NOT NULL DEFAULT '0', `date` bigint(20) NOT NULL, `ip` varchar(128) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE `{$dbprefix}navi` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `naviname` varchar(30) NOT NULL DEFAULT '', `url` varchar(75) NOT NULL DEFAULT '', `hide` enum('n','y') NOT NULL DEFAULT 'n', `icon` varchar(125) NOT NULL DEFAULT '', PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; INSERT INTO `{$dbprefix}navi` VALUES (1,'博客','https://www.52ecy.cn','n','glyphicon glyphicon-home'),(2,'关于','http://www.52ecy.cn/post-68.html','n',''),(3,'帮助','http://www.52ecy.cn/post-70.html','n',''); CREATE TABLE `{$dbprefix}user` ( `uid` int(10) unsigned NOT NULL AUTO_INCREMENT, `username` varchar(32) NOT NULL DEFAULT '', `password` varchar(64) NOT NULL DEFAULT '', `role` varchar(60) NOT NULL DEFAULT '' COMMENT '身份', `time` int(11) NOT NULL DEFAULT '0', `ip` varchar(128) NOT NULL DEFAULT '', `isseal` enum('n','y') NOT NULL DEFAULT 'n' COMMENT '封号', `photo` varchar(128) NOT NULL DEFAULT '' COMMENT '头像', `email` varchar(60) NOT NULL DEFAULT '', `activation` enum('n','y') NOT NULL DEFAULT 'n' COMMENT '激活', `activatecode` varchar(64) NOT NULL DEFAULT '' COMMENT '激活码', PRIMARY KEY (`uid`), KEY `username` (`username`) ) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC; REPLACE INTO `{$dbprefix}user` VALUES (1,'{$user}','{$password}','admin','{$time}','127.0.0.1','n','','','y',''); "; $array_sql = preg_split("/;[\r\n]/", $sql); foreach($array_sql as $sql){ $sql = trim($sql); if ($sql){ $mysqli->query($sql); } } $config = " '{$hostname}', 'username' => '{$dbuser}', 'password' => '{$dbpwd}', 'dbname' => '{$dbname}', 'port' => 3306, 'charset' => 'utf8', 'prefix' => '{$dbprefix}' );"; $fp = @fopen('config.php', 'w'); $fw = @fwrite($fp, $config); fclose($fp); if (!$fw){ Msg('配置文件(config.php)不可写。如果您使用的是Unix/Linux主机,请修改该文件的权限为777。如果您使用的是Windows主机,请联系管理员,将此文件设为可写'); } $result = "
恭喜,安装成功!
您的幻想领域图床已经安装好了,现在可以开始您的创作了,就这么简单!
桥豆麻袋,你得先到后台配置一下基本信息才能使用en~en~
用户名:{$user}
密 码:您刚才设置的密码
"; if (!@unlink('./install.php')){ $result .= '警告:请手动删除根目录下安装文件:install.php
'; } $result .= ""; Msg($result, 'no'); } /** 错消息提示 * $msg 提示信息 * $page 是否返回上一级 */ function Msg($msg,$page = 'yes'){ echo <<