Home  >  Article  >  Backend Development  >  求教一个基础的问题,name =“attachment.fileName”后台如何取值?

求教一个基础的问题,name =“attachment.fileName”后台如何取值?

WBOY
WBOYOriginal
2016-06-23 13:01:401834browse

前端定义了如下的一组input框,用来传递上传的文件信息





post方式提交到后台,后台该如何取值

尝试 $_REQUEST['attachment.id'];无法获得值
尝试 $_REQUEST['attachment']["id"];无法获得值

不知道该如何获得。请先达指教?


回复讨论(解决方案)

打印下$_REQUEST数组就知道了,, 

一般提交后"."都会被替换为"_"

$_REQUEST['attachment_id'];
 而且你attachment_id 的value并没有值

打印下$_REQUEST看看

print_r($_REQUEST); 





可以这样写,后台就可以
 $_REQUEST['attachment']["id"]; 取值了

var_dump($_REQUEST);

$_REQUEST['attachment_id'];
取得值,谢谢楼上两位,结贴

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn