English 中文(简体)
PHP和员额阵列
原标题:PHP and post arrays
  • 时间:2012-04-21 19:37:38
  •  标签:
  • php
  • post

在为员额变量使用员额阵列方面是否有任何坏之处?

<input type="text" id="stuff" name="stuff[text]"/>

而不是

<input type="text" id="stuff" name="stuff"/>    

何时使用?

最佳回答

没有理由不这样做。

然而,购买力平价在很大程度上是能够创造像这种阵列的唯一语言,因此,如果你把背书改为你可能不得不改变的另一种语言的话。

问题回答

情况不好。 典型的做法是,方案人员以这种方式使用阵列,以无确定的透镜的形式张贴阵列。 尽管如此。 Don tnow for certain, but when You wish to change methods to GET 然后, on IE <= 8 is a limit to 2048 chars in Address lenght. 充满活力的阵列可以轻松地满足这一限制。 在其他浏览器限值方面,则要高得多,或者没有。

这种方法的另一个缺点是,PHP将正确预设,但其他服务器辅助语文可能无法使用。 我知道,官方的“超文本”中对此做了具体规定。

因此,更应该把它放在一个站式的单间囚室里。 如果你想做一些名字,那么你可以这样写姓名:

姓名=“styff.text”

如同一些论坛发动机一样(某些Vanilla 2确实如此)。

如果对你没有疏远,我将保留在html名下单一变称。 这主要是因为背后。

For tips how to use them I could recommend to use such array to cover dynamic generated content on site. Still it can be handled with normal names, but it is pretty ugly. If we have a case that You want to do a picture adding system, that I would name each input file with "pic[]" and on server iterate whole table. The same thing for generating documents on client side. I would then do names like "content[][name]" "content[][type]" "content[][value]" and so on. Whathever I woud have in document part class I would throw in this kind of naming, and on server just check is set and do certain things for certain block of document.

这一点可以长时间讨论,因为每个方案管理员都有自己的技术,而且他们倾向于坚持这种技术。 例如,我以每个形式向现场投放,每个行动都由一名一般事务人员控制,然后由专门的控制员通过。

无。 如果有益的话,请四位您使用。





相关问题
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 ...

热门标签