On Jan 29, 8:50 am, question.
...@hotmail.com wrote:
> After some tinkering, I have now setup a hidden input which houses the
> count of the number of entries and it gets updated through the
> javascript which dynamically alters the page. I can then use it value
> in my php code as my counter.
> If there is a better approach I would be interested.
> QB
Use arrays. If your form elements look like this:
<input type="text" name="foo[]" />
Then they will be available as an array when you process it:
foreach($_SERVER['POST']['foo'] as $key => $value) {
//do something with each one
}
And you can easily know how many there are:
count($_SERVER['POST']['foo'])