开发者

Process form values via loop

开发者 https://www.devze.com 2023-02-28 09:30 出处:网络
I have a form that has fields with the following name <input type=\"t开发者_Python百科ext\" name=\"value[]\">

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

精彩评论

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

关注公众号