简体   繁体   English

服务器间错误:php访问动态创建的元素数组

[英]Inter Server Error : php access dynamically created element array

talbe row with as set of elements (textboxes) are dynamically created by Javascript like follow: 带有一组元素(文本框)的talbe行由Javascript动态创建,如下所示:

var newitemstr="<tr id='id_newitemrow_cnt'>"+
                "<td> <input type='checkbox' id='id_item_cnt'></td>" +
                "<td><input type='text' name='itemdesc[]' id='id_itemdesc_cnt' class='offerval'></td>"+
                "<td><input type='text' name='itemquty[]' id='id_itemquty_cnt' class='offerval'></td>"+
                "<td><input type='text' name='itemprice[]' id='id_itemprice_cnt' class='offerval'></td>"+
                "<td><input type='text' name='itemother[]' id='id_itemother_cnt' class='offerval'></td>"+
                "</tr>";

itemcnt = itemcnt + 1;

newitemstr = newitemstr.replace(/cnt/g, String(itemcnt));

//alert(newitemstr);
$("#id_itemtable").append(newitemstr);

after submitted, i want to retrieve the values that are input in the dynamically created textboxes using php file like : 提交后,我想使用php文件检索动态创建的文本框中输入的值,如:

$itemd = $_POST['itemdesc']; $itemq = $_POST['itemquty']; $itemp = $_POST['itemprice']; $itemo = $_POST['itemother']; $itemd = $_POST['itemdesc'];

however, i got "Internal Server Error", any suggestion about reasons? 但是,我得到“内部服务器错误”,有任何关于原因的建议吗? thanx in advance. 提前。

thanx a lot for reply. 非常感谢回复。 The problem is that in loop control, i miss "$" before index i. 问题是在循环控制中,我在索引i之前错过了“$”。

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

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