0

Form Post with multiple same names

<label for="vage">Age: <input class="age1" name="age1"> </label> I have a problem, This HTML Code is getting copied 4 times. But when i have the name "age" 4 times, only the last valueis getting send with POST to the next website, Is there any possible solution I can send all 4 "age" values?

14th Jul 2020, 1:42 PM
Julian Dörling
Julian Dörling - avatar
2 Réponses
0
HTML CODE <form method='post'> <input type='text' name='age1'> <input type='text' name='age2'> <input type='text' name='age3'> <input type='text' name='age4'> </form> PHP CODE : <?php if($_SERVER['REQUEST_METHOD'] == "POST"): // do something echo $_POST['age1']; // or anything echo $_POST['age2']; // etc. endif; ?> just make input with other name like age1,age2... hope it's help
14th Jul 2020, 1:57 PM
andy
andy - avatar
0
The Problem is the Code is getting copied, so all 4 inputs will have the name age1. Is there a js code that can change these names after they are being copied?
14th Jul 2020, 1:59 PM
Julian Dörling
Julian Dörling - avatar