I have got the following HTML form with several complicated input elements:
<input type="text" name="images[1]">
<input type="text" name="images[2]">
<input type="text" name="video[1]">
<input type="text" name="video[2]">
When I talk about cimplicated inputs I mean sophisticated name of elements:
name="images[1]"
Where images
is indicate group of input and [1]
number or identificator of input.
Using PHP approach of handling form It can be achieved like:
if(isset($_POST['images'])) {
foreach($_POST['images'] as $index) { // $key
echo $_POST['images'][$index]; // or key
}
}
How to reproduce this in Python?