I have a question.
Currently this form will be dynamically generated.
Example,
<form method="POST"> <input type="text" name="location" id="location1" /> <input type="submit" value="Submit!" /> <input type="text" name="location" id="location2" /> <input type="submit" value="Submit!" /> <input type="text" name="location" id="location3" /> <input type="submit" value="Submit!" /> <input type="text" name="location" id="location4" /> <input type="submit" value="Submit!" /> </form>
So whenever i press submit, it will take last value of form only. How do i make it take all $_POST?
Thank you.
Advertisement
Answer
Give each input its own name or use:
<input type="text" name="location[]" id="location1" />
Then PHP will treat it like an array.