马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
<?php
header("content-type:text/html;charset=utf-8");
$serverip = $_POST['host'];
$sqluser = $_POST['sqluser'];
$sqlpwd = $_POST['sqlpwd'];
if($_POST['engine']){
$engine = 'MyIsam';
}else{
$engine = 'InnoDB';
}
$conn = mysql_connect($serverip,$sqluser,$sqlpwd) or die('不能连接到数据库!');
$database = $_POST['dbname'];
mysql_select_db($database,$conn) or mysql_query("CREATE DATABASE '$database'",$conn);
mysql_query('set names gbk');
$admins = "create table Administrators(
Username varchar(20) not null primary key,
Password varchar(20) not null,
Email varchar(30)
)engine = '$engine';";
$IDlenth = $_POST['IDlenth'];
$users = "create table Users(
UserID char(" + $IDlenth + ") not null primary key,
Username varchar(20) not null,
Password varchar(20) not null,
Email varchar(30)
)engine = '$engine';";
mysql_query($admins,$conn);
mysql_query($users,$conn);
$adminuser = $_POST['adminuser'];
$adminpwd = $_POST['adminpwd'];
$adminmaill = $_POST['adminmaill'];
mysql_query("insert into Administrators value("'$adminuser'","'$adminpwd'","'$adminmaill'")",$conn);
?>
|