| 项目搜索 |
| |
|
代码片段库:
查看代码片段
浏览
| 提交新的代码片段
| 创建代码包
setup_ok.php
|
类型:
Full Script |
类别:
BBS Systems
|
许可证:
GNU General Public License |
语言:
PHP
|
描述:
可换SKIN的BOARD中的安装处理文件
|
该代码片段的版本系列:
片段ID |
下载版本 |
提交时间 |
提交人 |
删除 |
25 | 1.0 | 2002-03-05 14:48 | firefox | |
点击"下载版本"来下载该代码片段.
最新版本的代码片段: 1.0
<?
include "lib.php";
if($step=="2") {
include "schema.sql";
if(isBlank($hostname)) Error("主机名不能为空","");
if(isBlank($user_id)) Error("用户名不能为空","");
if(isBlank($dbname)) Error("数据库名称不能为空","");
$connect = @mysql_connect($hostname,$user_id,$password) or Error("MySQL-DB Connect<br>Error!!!","");
if(mysql_error()) Error(mysql_error(),"");
mysql_select_db($dbname, $connect ) or Error("MySQL-DB Select<br>Error!!!","");
if(!isTable($admin_table,$dbname)) @mysql_query($admin_table_schema, $connect) or Error("论坛管理表的建立 无法进行","");
else $admin_table_exist=1;
if(!isTable($group_table,$dbname)) @mysql_query($group_table_schema, $connect) or Error("用户组管理表的建立 无法进行","");
else $group_table_exist=1;
if(!istable($member_table,$dbname)) @mysql_query($member_table_schema, $connect) or Error("普通用户信息表的建立 无法进行","");
else $member_table_exist=1;
if(!istable($get_memo_table,$dbname)) @mysql_query($get_memo_table_schema, $connect) or Error("悄悄话收件箱的建立 无法进行");
else $get_memo_table_exists=1;
if(!istable($send_memo_table,$dbname)) @mysql_query($send_memo_table_schema, $connect) or Error("悄悄话已发件箱的建立 无法进行");
else $send_memo_table_exist=1;
if(!istable($now_table,$dbname)) @mysql_query($now_connect_table_schema,$connect) or Error("当前状态表的建立 无法进行") ;
else $now_connect_table_exists=1;
$file=@fopen("config.php","w") or Error("对config.php 的读取操作 无法进行<br><br>请确认已将文件读写权限改为707","");
@fwrite($file,"<?\n$hostname\n$user_id\n$password\n$dbname\n?>\n") or Error("对config.php 的写入操作 无法进行<br><br>请确认已将文件读写权限改为707","");
@fclose($file);
@mkdir("data",0707);
@mkdir("icon",0707);
@chmod("data",0707);
@chmod("icon",0707);
@chmod("config.php",0707);
$temp=mysql_fetch_array(mysql_query("select count(*) from $member_table where is_admin = '1'",$connect));
mysql_close($connect);
if($temp[0]) {movepage("admin.php");}
else {movepage("setup.php?step=3");}
} else if($step=="3"){
$connect=dbConn();
$temp=mysql_fetch_array(mysql_query("select count(*) from $member_table where is_admin='1'",$connect));
if($temp[0])
{
header("location:admin.php");
mysql_close($connect);
exit;
}
if(isBlank($user_id)) Error("用户帐号 不能为空","");
if(isBlank($password1)) Error("用户密码 不能为空","");
if(isBlank($password2)) Error("用户密码确认 不能为空","");
if($password1!=$password2) Error("密码与密码确认不符","");
if(isBlank($name)) Error("用户名称 不能为空","");
@mysql_query("insert into $member_table (user_id,password,name,is_admin,reg_date,level)
values ('$user_id',password('$password1'),'$name','1','".time()."','1')",$connect)
or Error(mysql_error(),"");
mysql_close($connect);
header("location:admin.php");
}
?>
如果您修改了一个代码片段并且觉得很应该让别人共享,您可以把这作为这个代码片段的最新版本提交上来. |
|