我正在用 php 创建一个恢复数据库脚本,但它不起作用。这是到目前为止的代码
<form action = '' method = 'POST'>
<h2>Restore</h2>
<table>
<tr><td><input type=file name="file"></td></tr>
<tr><td><input type = 'submit' name = "restore" value="restore"></tr></td>
</table>
</form>
<?php
$host = 'localhost';
$user = 'root';
$pass = ' ';
$dbname = 'itravel';
//date_default_timezone_set('Asia/Kuala_Lumpur');
//$currentdate = date('YmdGis');
$restore_name = $_POST['file'];
$custompath = $_POST['path'];
if(isset($_POST['restore']))
{
$restore = "c:/xampp/mysql/bin/mysql -h $host -u $user $dbname < $backup_name";
system($restore);
}
?>
单击恢复按钮后没有任何反应。请帮忙