在循环中形成传递值问题

编程入门 行业动态 更新时间:2024-10-25 22:30:05
本文介绍了在循环中形成传递值问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我想知道在循环中使用它时如何分配和获取表单值。我无法获得我在''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 =

更多推荐

在循环中形成传递值问题

本文发布于:2023-10-12 01:31:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1483377.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!