if (($ext=="zip")
&& ($_FILES["file"]["size"] < 2000000))
{
if ($_FILES["file"]["error"] > 0)
{
echo "Error: " . $_FILES["file"]["error"] . "<br />";
}
else
{
$newname = 'forms/'.$filename;
move_uploaded_file($_FILES['file']['tmp_name'],$newname);
mysqli_select_db($connect,"forms");
$s = "update loc set loc='$newname' where sessionusername = '$u' AND name = '$name'";
$q = mysqli_query($connect,$s);
if($q)
{
header("Location:change.php");
exit();
}
else
{
echo "Oops, something went haywire. Please try again";
}
}
}
else
{
echo "Invalid file. Please try again.";
}
}
當我上傳的文件,我得到的錯誤:1個幫助這個文件上傳腳本
更新 - 代碼在FF.NOT在Chrome中。
是頁面只是輸出'1'?你嘗試過調試還是至少把'echo()'和找出程序的路徑?可能有助於 – JohnP 2011-04-05 12:04:40
我喜歡「哎呀,事情失控了,請重試」 :) – 2011-04-05 12:11:08
@lawrence公頃ha..thanks。 – sarthak 2011-04-05 12:32:06