下面是給定的代碼。我想在上傳之前重命名文件。提交時顯示錯誤:未定義的索引。使用PHP重命名和上傳文件時出錯 - 未定義索引
if($_FILES['FPScreenShot']['name']==true)
{
$SPPic = ($_FILES['FPScreenShot']['name']);
$curTime = time();
$NewPriorPic = "prior";
$NewPriorPic = $NewPriorPic.$SGeiNo;
$NewPriorPic = $NewPriorPic.$SSurgDt;
$NewPriorPic = $NewPriorPic.$curTime;
move_uploaded_file($_FILES['FPScreenShot']['tmp_name'] , "upload_pictures/".$_FILES['$NewPriorPic']['name']);
}
else
{
$SPPic = "NIL";
}
您的代碼包含語法錯誤。 – Raptor 2014-12-08 08:19:03
可能重複的[參考 - 這個錯誤在PHP中意味着什麼?](http://stackoverflow.com/questions/12769982/reference-what-does-this-error-mean-in-php) – 2014-12-08 08:19:35
檢查您的使用在'move_uploaded_file'(' – RichardBernards 2014-12-08 08:19:35