注册 登录
编程论坛 PHP技术论坛

php文件上传问题

wzy19890624 发布于 2008-07-17 21:05, 1730 次点击
前台页面:
<html>

<head>
  <title>PHP上传文件表单</title>
</head>

<body>

<form enctype="multipart/form-data" action="upload.php" method="post">
    <input type="hidden"  name="max_file_size" value="1000000">
<center>请选择上传文件:
    <input name="userfile" type="file">
    <input type="submit" value="上传">
</center>

</form>


</body>

</html>


后台页面:
<?php

    $uploaddir = 'c:/a/';
    $uploadfile = $uploaddir. $_FILES['userfile']['name'];

    print "<pre>";
    if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
        print "上传成功!\n";
        print_r($_FILES);
    } else {
        print "上传失败了\n";
        print_r($_FILES);
    }
    print "</pre>";

?>

高手帮我解释一下那个文本隐藏域的字段名称为什么一定要是max_file_size换了别的为什么不行,还有就是后台页面中的$_FILES数组变量 这两个变量我怎么在网上怎么找也找不到,正确的解释,希望高手给个答案,谢谢!!最好能有相应的资料
4 回复
#2
wzy198906242008-07-18 06:25
怎么都没人来帮我啊
#3
lmhllr2008-07-18 17:14
回复 1# wzy19890624 的帖子
查PHP手册,怎么可能找不到呢......
#4
ming2062008-07-25 17:32
这在PHP4中就已经有了说明。。。。。。
#5
朕有孕在身2008-08-03 00:10
max_file_size是PHP定死的,你记住不能换别的名字就可以了

$_FILES数组变量的知识很多啊,用Google别用百度,百度会把$号给忽略

http://www.
1