import.php3/导入数据库
<?
session_start();
if ($remark=="true")
{
if ($importfile!= "none")
{
copy($importfile,"e:\homepage\databaseimport\{$importfile_name}");
$importcommand="e:\hubo\mysql\bin\mysql -u {$user} -p{$password} $user < e:\homepage\databaseimport\{$importfile_name}";
system($importcommand);
$delcommand="del e:\homepage\databaseimport\{$importfile_name}";
system($delcommand);
unlink($importfile);
echo "{$importfile_name}导入成功";
}
}
?>
<head>
<title>
数据库导入
</title>
<style>
td{font-size:9pt}
body{font-size:9pt;background-color:#D0D2E3}
input { background-color: #FFFFFF; border: 1px #000000 dashed}
.no { background-color: #D4D0C8}
</style>
</head>
<form method=post action=import.php3 ENCTYPE="multipart/form-data" >
<input type=file name=importfile><br>
<input type=hidden name=remark value="true">
<input type=submit value=数据库导入 class=no>
</form>
|