开发者

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
   }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜