English 中文(简体)
将数量不详的田地送至PHP的文字
原标题:Submitting an unknown number of fields to a PHP Script
  • 时间:2012-01-13 03:23:32
  •  标签:
  • php

我的情况是: 页: 1 在创建网页(使用PHP书)时,一些浏览器的囚室填满了文字,而其余的囚室填满了文字箱。 我想要做的是,允许用户填充任何带有文字箱的浏览量,然后将其交给硬拷贝。

当用户点击提交时,我想接上用户填满的所有段(主要是带有填充文字箱的行),仅将这些文本箱中的数据提交文字,最好是在2D阵列中,阵列的每一行都代表了表格的浏览量?

最佳回答

您也可宣读<条码>输入,标有如<条码>领域[]。 提交时,将把<代码>_$_POST[field] 列入载有用户提供的数据的阵列。

HTML

<tr>
    <td><input type="text" name="fields[]" /></td>
    <td><input type="text" name="fields[]" /></td>
    <td><input type="text" name="fields[]" /></td>
</tr>

PHP

var_dump($_POST[ fields ]); // User submitted data
问题回答

我将每个电池的名称定为<代码>cell<column number>$<row number>,然后,你在PHP的文字中所做的一切是检查所有可能的条目,如果这些条目被送至服务器并适当使用数据,即可发现。





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签