当我尝试通过浏览器访问PHP文件(位于服务器上)时,出现以下错误:
C:\xampp\htdocs\android_im\handle_upload.php
<?php
$target_path = "./";
$target_path = $target_path . basename($_FILES['uploadedfile']['name']);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path))
{
echo "The file ". basename($_FILES['uploadedfile']['name']) ." has been uploaded";
}
else
{
echo "There was an error uploading the file, please try again!";
}
?>
浏览器错误:
Notice: Undefined index: uploadedfile in C:\xampp\htdocs\android_im\handle_upload.php on line 3
Notice: Undefined index: uploadedfile in C:\xampp\htdocs\android_im\handle_upload.php on line 4
There was an error uploading the file, please try again!