0

I have a form which has variable input values .For example one customer has bought 5 items so all of them show another customer has bought 3 items so only three items show up.All these values are based on database

<form id="customer" class="customer" method="post" action="">
    <input type="text" name="customer1" value="" > 
    <input type="text" name="customer2" value="" > 
    <input type="text" name="customer3" value="" > 
</form>

Now my question how do i process a form like this where every time the number of post variables is different.

1
  • Thanks I got the point , appreciate your help. Commented Mar 1, 2011 at 21:40

2 Answers 2

1

<input type="text" name="customer[]" value="" >

Sign up to request clarification or add additional context in comments.

Comments

1

Something like:

$products = array();
foreach ($_POST as $key => $value) {
    array_push($products, $key, $value);
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.