我有一个包含文件输入的简单HTML表单。当表单在没有文件的情况下提交时,打印$_POST数组将显示提交的所有数据。但是,当提交文件时,$_POST不会打印出任何提交的数据。
有人能告诉我为什么吗?这是我的代码:
<?php
print_r($_POST);
?>
<form action="test.php" method="post" enctype="multipart/form-data">
<label for="myfile">Video File:</label>
<input type="file" name="myfile" />
<br /><br />
<label for="mytitle">Title:</label><br />
<input type="text" name="mytitle" size="55" maxlength="60" />
<br /><br />
<input type="submit" name="mysubmit" value="Submit Video for Approval" />
</form>发布于 2013-01-02 07:34:17
你的脚本看起来不错。请检查您的服务器配置。可能您超过了帖子限制(在php.ini中使用post_max_size设置)
发布于 2013-01-02 07:32:44
您必须使用$_FILES来访问上传的文件。
var_dump($_FILES); // Your uploaded files
var_dump($_POST); // Your entered datahttps://stackoverflow.com/questions/14115247
复制相似问题