PHP 文件上传表单无法提交 POST 变量? [英] PHP file upload form cannot submit a POST variable?
问题描述
我有一个带有 method="post" enctype="multipart/form-data"
我正在尝试做一个 <input type = "hidden" name = 'something' value = "something"/>
以及文件上传的输入,但我不能在上传处理脚本中获取 'something' 的值,例如 $_POST['something']
I am trying to do a <input type = "hidden" name = 'something' value = "something"/>
along with the input for file upload, but I am not able to get the value of 'something' in the upload handling script like $_POST['something']
上传文件时不能使用 POST 变量吗?关于如何将信息传递给上传处理脚本的任何其他替代方法?
Is it not possible to use POST variables along with a file upload? Any other alternative on how I can pass information to the upload handling script?
推荐答案
首先,与您使用的引号保持一致是一个很好的第一步.
First, having some consistency with which quotes you use would be a good first step.
其次,您的 enctype
是正确的,所以可能的问题是您超出了服务器 file upload size
或 post size代码>设置.尝试上传较小的文件,看看是否有效.
Second, you have got the enctype
correct, so what may be an issue is you've exceeded the servers file upload size
or post size
settings. Try upload a smaller file and see if that works.
这篇关于PHP 文件上传表单无法提交 POST 变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!