我动态创建了文本框。在所有这些文本框中,有两件事是不变的 - 'class=data_textboxes','name=text_[根据数据库值的文本框名称]'。
这些文本框采用表单形式,当我提交时,如何一一访问所有这些文本框值或将所有这些值放入数组中。我需要使用 php 对这些值进行服务器验证。
其次,我想将这些值发送到数据库,我如何将值发送到数据库(对应于其数据库值)
让我解释一下第二种情况。假设数据库公司值为“yahoo”,那么其相应的文本框名称将为 name="text_yahoo" 并且还有很多其他公司。那么如何将 text_yahoo 文本框的值发送到引用 yahoo 的数据库?
i had dynamically created textboxes.two things are constant in all these texboxes -'class=data_textboxes','name=text_[name of textbox as per database value]'.
these textboxes are in a form and when i submit how can i access all those textboxes values either one by one or get all of them in an array.i need to do server validation on these values using php.
secondly i want to send these values to database,how can i the values to database(corresponding to its database value)
let me explain 2nd scenario wid n xample. suppose database company value is ="yahoo" then its corresponding textbox name will be name="text_yahoo" and there are lots of other companies..so how to send values of text_yahoo textbox to database referencing to yahoo??
发布评论
评论(1)
基本上,这个想法是查看字段名称,如果它们以某些文本开头,那么它就是您要查找的字段。
Basically the idea is to look at field names and if they start with certain text then it's the field you're looking for.