php上传函数问题 5
用以下代码,关于上传的,总是出现问题<?phpif($upfile=="none"){echo"没有选择文件";echo"<p>";echo"点<ahref=\"8-15...
用以下代码,关于上传的,总是出现问题
<?php
if ($upfile=="none")
{
echo "没有选择文件";
echo "<p>";
echo "点<a href=\"8-15.php\">这里</a>返回";
}
else
{
$filepath="images/";
$filename=$filepath.$upfile_name;
echo $upfile_name;
echo "<p>";
echo $upfile_size;
echo "<p>";
echo $upfile_type;
if (copy($upfile, $filename))
{
unlink($upfile);
echo "<p>";
echo "指定文件已经上传!";
echo "<p>";
echo "点<a href=\"8-15.php\">这里</a>返回";
}
else
{
echo "文件上传失败!";
}
}
?>
出现错误,但是没发现错误在哪儿。
Notice: Undefined variable: upfile in D:\wamp\www\part01\8-16.php on line 2
Notice: Undefined variable: upfile_name in D:\wamp\www\part01\8-16.php on line 11
Notice: Undefined variable: upfile_name in D:\wamp\www\part01\8-16.php on line 12
Notice: Undefined variable: upfile_size in D:\wamp\www\part01\8-16.php on line 14
Notice: Undefined variable: upfile_type in D:\wamp\www\part01\8-16.php on line 16
Notice: Undefined variable: upfile in D:\wamp\www\part01\8-16.php on line 17
Warning: copy() [function.copy]: Filename cannot be empty in D:\wamp\www\part01\8-16.php on line 17
文件上传失败! 展开
<?php
if ($upfile=="none")
{
echo "没有选择文件";
echo "<p>";
echo "点<a href=\"8-15.php\">这里</a>返回";
}
else
{
$filepath="images/";
$filename=$filepath.$upfile_name;
echo $upfile_name;
echo "<p>";
echo $upfile_size;
echo "<p>";
echo $upfile_type;
if (copy($upfile, $filename))
{
unlink($upfile);
echo "<p>";
echo "指定文件已经上传!";
echo "<p>";
echo "点<a href=\"8-15.php\">这里</a>返回";
}
else
{
echo "文件上传失败!";
}
}
?>
出现错误,但是没发现错误在哪儿。
Notice: Undefined variable: upfile in D:\wamp\www\part01\8-16.php on line 2
Notice: Undefined variable: upfile_name in D:\wamp\www\part01\8-16.php on line 11
Notice: Undefined variable: upfile_name in D:\wamp\www\part01\8-16.php on line 12
Notice: Undefined variable: upfile_size in D:\wamp\www\part01\8-16.php on line 14
Notice: Undefined variable: upfile_type in D:\wamp\www\part01\8-16.php on line 16
Notice: Undefined variable: upfile in D:\wamp\www\part01\8-16.php on line 17
Warning: copy() [function.copy]: Filename cannot be empty in D:\wamp\www\part01\8-16.php on line 17
文件上传失败! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询