Php post form submission consultation form for obtaining name: unlimited input box
For example, I added three input boxes, which are displayed:
After the post is submitted, I want to get the value of form1 in php for the value of form2 ....
How can we use a for loop to achieve the following results?
For omitted ..{
Formm = $ _ GET [form $ I];
S = formm;
}
The output is
S = $ _ GET [form1] value
S = $ _ GET [form2] value
S = $ _ GET [form3] value
Reply to discussion (solution)
Foreach ($ _ GET as $ key => $ value) {echo $ key. '='. $ value; // s = ??? You S = each value. Are you sure you want this?
Foreach ($ _ GET as $ key => $ value) {echo $ key. '='. $ value; // s = ??? You S = each value. Are you sure you want this?
Yes, because I want to store it in the same field, it should be S. =
However, I may not be clear about it.
$ Key. '='. $ value; this method does not seem to meet my requirements.
For example, in this form
Type = "hidden"
Add button, click to load
After submission, The post sent is title form url form1 url1 form2 url2
Php
Num = value obtained by adding a button
I = 1
When I <= num I ++
How can I get
Form url form1 url1 form2 url2 value? Achieve the following results:
For (I = 1; I <= num I ++ ){
......
S. = form url
}
Output:
S. = $ _ GET [form1] url1. .. value
S. = $ _ GET [form2] url2. .. value
.......
$a = array( 'url1' => 1, 'url2' => 2, 'url3' => 3, 'url4' => 4,);for($i=1; $i<=4; $i++) echo $a['url'.$i], PHP_EOL;
1
2
3
4