在循环中形成传递值问题 [英] form passing value problem in loop

查看:75
本文介绍了在循环中形成传递值问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想知道在循环中使用它时如何分配和获取表单值。我无法获得我在''Desc''部分插入的所有输入,它来自此网站。我做循环时可以知道这项工作吗?谢谢。

a.php

[HTML] //这可行吗

< font size =" ; 2">标题:< / font>< br>< input type =" text"名称= QUOT;标题[] QUOT;大小= QUOT; 40" value ="<?php echo htmlentities($ match [$ counter],ENT_QUOTES); ?>">

< / tr>

< tr>& nbsp;< / tr>

/ /但这只能在多个帖子时获得最后一个输入

< tr>

< font size =" 2">描述:< / font> ;

< script language =" JavaScript" type =" text / javascript">

<! -

function submitForm(){

updateRTE(''Desc' ');

返回true;

}


initRTE(" images /",""," ;");

writeRichText(''Desc'','''',350,200,true,false);


// - - >

< / script>

< / tr> [/ HTML]
b.php

[PHP] $ title = $ _POST [''Title''];

$ desc = $ _POST [''Desc''];

mysql_query(" insert into post(title,description)values(''title [$ counter]'',''$ desc [$ counter]'')")或die(mysql_error()); [/ PHP ]

Hi all,
I would like to know how to assign and get the form value when I using it in a loop. I cannot get all the input that I inserted in ''Desc'' part and it is from this site. May I know to get this work when I do a loop? Thanks.

a.php
[HTML]// this can work
<font size="2">Title:</font><br><input type="text" name="Title[]" size="40" value="<?php echo htmlentities($match[$counter], ENT_QUOTES); ?>">
</tr>
<tr>&nbsp;</tr>
// but this can only get the last input when do multiple post
<tr>
<font size="2">Description:</font>
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
updateRTE(''Desc'');
return true;
}

initRTE("images/", "", "");
writeRichText(''Desc'', '''', 350, 200, true, false);

//-->
</script>
</tr>[/HTML]
b.php
[PHP]$title= $_POST[''Title''];
$desc= $_POST[''Desc''];
mysql_query("insert into post(title, description)values (''$title[$counter]'', ''$desc[$counter]'')")or die (mysql_error());[/PHP]

推荐答案

match


counter],ENT_QUOTES); ?>">

< / tr>

< tr>& nbsp;< / tr>

/ /但这只能在多个帖子时获得最后一个输入

< tr>

< font size =" 2">描述:< / font> ;

< script language =" JavaScript" type =" text / javascript">

<! -

function submitForm(){

updateRTE(''Desc' ');

返回true;

}


initRTE(" images /",""," ;");

writeRichText(''Desc'','''',350,200,true,false);


// - - >

< / script>

< / tr> [/ HTML]
b.php

[PHP]
counter], ENT_QUOTES); ?>">
</tr>
<tr>&nbsp;</tr>
// but this can only get the last input when do multiple post
<tr>
<font size="2">Description:</font>
<script language="JavaScript" type="text/javascript">
<!--
function submitForm() {
updateRTE(''Desc'');
return true;
}

initRTE("images/", "", "");
writeRichText(''Desc'', '''', 350, 200, true, false);

//-->
</script>
</tr>[/HTML]
b.php
[PHP]


title =


这篇关于在循环中形成传递值问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆