这里没有访问我的文件上传脚本,我收到以下错误
Notice: Undefined index: fupload in C:\Users\Tuskar\Desktop\Projekt\htdocs\Project IT-Space\Profile\edit_profile_parse.php on line 8
但根据不应该有错误,因为我确定的指标。看起来我没有访问$ _FILES数组,因为之前我得到这个错误一直得到其他类似的错误或程序完全通过如果并直接去其他(文件没有选择)
我知道剧本是原始的,几乎不包括安全,但我只想在我添加其他功能,如最大文件大小或文件限制它第一工作... :(
这里是我使用的代码。
Upload Picture
<form action="edit_profile_parse.php" method="get" enctype="multipart/form-data" >
<input type="hidden" name="MAX_FILE_SIZE" value="999999999"> </input>
<input type="file" name="fupload"> </input>
<input type="submit" name="submit" value="Upload"> </input>
</form>
这里是处理表格的php
if (isset($_GET['submit']))
{
if (isset($_FILES['fupload']))
{
echo "name: ".$_FILES['fupload']['name']." <br> ";
echo "size: ".$_FILES['fupload']['sizw']." <br> ";
echo "type: ".$_FILES['fupload']['type']." <br> ";
if ($_FILES['fupload']['type'] == "image/gif")
{
$source = $_FILES['fupload']['tmp_name'];
$target = "images/" .$_FILES['fupload']['name'];
move_uploaded_file($source, $target) or die ("Error: " .mysql_error());
$size = getImageSize($target);
$imgstr = "<img src=\" '".$target."' \">";
echo $imgstr;
}
else
{
echo "Problem uploading the file ... ";
}
}
else
{
echo "No file chosen !! ";
}
}
else
{
echo "Button not clicked ";
}
非常感谢你:)哇,这么多时间投资于“调试”,因为只有一种怪异的方法:D –
是啊..任何时候:) –