简体   繁体   English

读取 HTML 表单数据

[英]Reading the HTML Form data

my html form is sending data to the server as :我的 html 表单将数据发送到服务器:

{ r1: [ '1', '2', '3' ],
  r2: [ 'Top', 'Greg', 'Andy' ],
  r3: [ 'validuser', 'invaliduser', 'validuser' ] }

I know that this is a group infpormation for 3 sets (3 Arrays)我知道这是 3 组(3 个数组)的组信息

1,Top,Validuser
2, greg, invaliduser
3, Andy , valid user 

How can I make/Read to have them as an array as mentioned?如上所述,我如何制作/阅读以将它们作为数组?

The form is sending like that because it is based on a java script template where in I have the template of the form :表单是这样发送的,因为它基于一个 java 脚本模板,其中我有表单的模板:

   <td>   <input type="text" name="r1" id="mytext" size="9" value=${usernumber} /> </td>      

Assuming you're using POST, you'd read the value like this:假设您正在使用 POST,您会读取这样的值:

$var_array[1]=$_POST["mytext"]; $var_array[1]=$_POST["mytext"];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM