<?php 
include("loginkey.php");//引入权限检测文件
echo "<script>alert('演示版不支持数据库还原');location.href='sys_base.php';</script>";
exit();

/**
// Name of the file
$filename = $_POST['mybaseurl'];
// MySQL host
$mysql_host = $_POST['mylocalhost'];
// MySQL username
$mysql_username = $_POST['myroot'];
// MySQL password
$mysql_password = $_POST['mypwd'];
// Database name
$mysql_database = $_POST['mybm'];

// Connect to MySQL server
mysql_connect($mysql_host, $mysql_username, $mysql_password) or die('连接库连接错误:请检查密码或用户名 ');
mysql_query("set names utf8");
// Select database
mysql_select_db($mysql_database) or die('数据库打开错误: 请检查数据库名是否正确');

// Temporary variable, used to store current query
$templine = '';
// Read in entire file
$lines = file($filename);
// Loop through each line
foreach ($lines as $line)
{
// Skip it if it's a comment
if (substr($line, 0, 2) == '--' || $line == '')
    continue;

// Add this line to the current segment
$templine .= $line;
// If it has a semicolon at the end, it's the end of the query
if (substr(trim($line), -1, 1) == ';')
{
    // Perform the query
    mysql_query($templine) or print('数据执行错误 \'<strong>' . $templine . '\': ' . mysql_error() . '<br /><br />');
    // Reset temp variable to empty
    $templine = '';
}
}
 echo "<div style='margin:50px auto;'><h1>数据库导入完成,<a href='sys_base.php'>返回管理</a></h1></div>";
*/
?>
