我收到以下错误,我不知道为什么。
注意:未定义索引:在第 3 行的 C:\xampp\htdocs\site\upload.php 中上传
注意:未定义变量:第 7 行 C:\xampp\htdocs\site\upload.php 中的上传大小
注意:未定义的变量:第 14 行 C:\xampp\htdocs\site\upload.php 中的上传类型
注意:未定义索引:在第 29 行的 C:\xampp\htdocs\site\upload.php 中上传
我试图在这篇文章中包含 php 的来源,但不能。这是pastebin的链接:我的源代码
<?php
$target = "upload/";
$target = $target . basename( $_FILES['uploaded']['name']) ;
$ok=1;
//This is our size condition
if ($uploaded_size > 350000)
{
echo "Your file is too large.<br>";
$ok=0;
}
//This is our limit file type condition
if ($uploaded_type =="text/php")
{
echo "No PHP files<br>";
$ok=0;
}
//Here we check that $ok was not set to 0 by an error
if ($ok==0)
{
Echo "Sorry your file was not uploaded";
}
//If everything is ok we try to upload it
else
{
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded";
}
else
{
echo "Sorry, there was a problem uploading your file.";
}
}
?>
编辑 1:我从 about.com about.com获得代码