php 程序包_php安装包制作

header("content-type:text/html;charset=utf8");

$host = isset($_POST['host'])?$_POST['host']:"";

$user = isset($_POST['user'])?$_POST['user']:"";

$password = isset($_POST['password'])?$_POST['password']:"";

$db_name = isset($_POST['db_name'])?$_POST['db_name']:"";

$db_prefix = isset($_POST['db_prefix'])?$_POST['db_prefix']:"";

$install = isset($_POST['install'])?$_POST['install']:'';

if(!is_writable("./data/config.php")){

echo ("配置文件不可写,请检查配置文件的权限!");

}

$configStr = '<?php $mysql_host='."'{$host}'".';$mysql_user='."'{$user}'".';$mysql_password='."'{$password}'".';

$db_name = '."'{$db_name}'".';$db_prefix = '."'{$db_prefix}'".';?>';

echo $configStr;

$fp = fopen("./data/config.php","w+");

fwrite($fp,$configStr);

//==================================

include_once ("data/config.php");

if(!@$link = mysqli_connect($host,$user,$password)){

echo "数据库连接失败!";

}else{

echo "数据库连接成功!";

$createSql = "create database `$db_name`";

mysqli_query($link, $createSql);

mysqlI_select_db($link,$db_name);

$sql_query[] = "create table `".$db_prefix."_admin_log1`(

`id` int(8) unsigned not null auto_increment key

);";

$sql_query[] = "create table `".$db_prefix."_admin_log2`(

`id` int(8) unsigned not null auto_increment key

);";

foreach($sql_query as $sql){

mysqli_query($link,$sql);

//echo $sql;

echo "导入成功..."."
";

}

}

?>

  • 填写主机:
  • 用户名:
  • 密码:
  • 数据库名:
  • 数据前缀:
  • 提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值