Php post form submission to obtain the name

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.