I have a PHP loop which outputs a series of identical form controls (they must be identical).
<input type=text value="Text Here" name="text_input">
<input type=text value="Text Here" name="text_input">
<input type=text value="Text Here" name="text_input">
<input type=text value="Text Here" name="text_input">
I have no problems styling with class names and whatnot in CSS, however on the back end, PHP can’t get all of the data at once, because they are all using the same name.
How can I make it so that PHP can get and handle all of the fields? Do I need to configure something in PHP, or is there a nifty HTML trick that I’m missing?
Thanks in advance.
You could just add
[]to the end of the name and it will be an array on the back end in php. Something like:in php would be:
Other than that, why do the names “have to be identical”?