下面是我的代碼:無法上傳文件的PHP
<?php
$name = $_FILES["file"]["name"];
$temp = $_FILES["file"]["temp"];
if(isset($name))
{
if(!empty($name))
{
$location= "upload/";
if(move_uploaded_file($temp, $location.$name))
{
echo "Uploaded!!!";
}
else
{
echo "Error:";
}
}
else
{
echo "Please choose a file to upload";
}
}
?>
<form action= "upload.php" method="POST" enctype="multipart/form-data">
<input type="file" name="file" ><br><br>
<input type="Submit" value="Submit" >
</form>
每當我運行此代碼,我得到以下錯誤,請幫助。我是PHP新手,需要儘快學習它。提前致謝。
注意:未定義指數:溫度在C:\ XAMPP \ htdocs中\ testfolder \ upload.php的在第3行
非常感謝您的答案..它真的幫助..再次感謝! – Deepak