Soldato
Hi,
I've come across a small problem in a project I'm working on. The project requires me allow the user to add a com pany details via a form and add unlimited clients for that company.
I came across useful article - http://mohdshaiful.wordpress.com/2007/05/31/form-elements-generation-using-jquery/ - that allows the user to generate a new form value dynamically.
In this tutorial he uses an array for fields field names to make it possible to grab these submitted values. In opne one his comments he says:
Can some please give me an example in PHP how I loop through these posted values?
Thanks
I've come across a small problem in a project I'm working on. The project requires me allow the user to add a com pany details via a form and add unlimited clients for that company.
I came across useful article - http://mohdshaiful.wordpress.com/2007/05/31/form-elements-generation-using-jquery/ - that allows the user to generate a new form value dynamically.
In this tutorial he uses an array for fields field names to make it possible to grab these submitted values. In opne one his comments he says:
The idea of naming this way (name=”txt[ ]”) is to simplify processing in the server-side code (e.g. insert to DB).
So in the server-side code, say PHP, u need to write something to count the elements of $_POST[’txt’] array. Then, using the value u need to construct a while or for loop to process the array, which will be accessible through $_POST[’txt’][0], $_POST[’txt’][1], $_POST[’txt’][2]…
Can some please give me an example in PHP how I loop through these posted values?
Thanks