Process form values via loop
I have a form that has fields with the following name
<input type="t开发者_Python百科ext" name="value[]">
<input type="text" name="value[]">
<input type="text" name="value[]">
On form submit I need to run a query and store each submitted non-empty values into my db. How do I do that? I suppose I need to run loop but not sure how and especially to avoid blank field submissions.
foreach($_POST['value'] as $val)
{
if($val != "")
{
//process query, $val will have the tag's value
}
}
精彩评论