PHP $ _ get html Form (Form) or url data

Source: Internet
Author: User
I have nothing to do today to tell you that I learned php many years ago to learn how to use get global variables. For more information, see.

I have nothing to do today to tell you that I learned php many years ago to learn how to use get global variables. For more information, see.

1. $ _ GET is used to obtain data in the form of get in the table method.

2. $ _ GET url. php? I = 12 data,

The above is the data we often use get to obtain values,

Instance 1: Get form data

The instance code is as follows:

  1.  

Get. php

If I fill in a http://www.phpfensi.com

The instance code is as follows:

  1. You are .

The output result is

The instance code is as follows:

  1. You are http://www.phpfensi.com

What is the url style when we click to submit?

The instance code is as follows:

  1. Get. php? Username = www.phpfensi.com

This form is the second method we are talking about to obtain data. next we will look at using a for reference.

/A. php? Value = my

A. php

The instance code is as follows:

  1. The value of value is .  

The output result is

The instance code is as follows:

  1. The value of value is my.

This seems to be no different from form's method = get. haha, the article is here.

There is another way to get, that is, the form of direct $ _ GET, and view the instance.

The instance code is as follows:

  1. Apple  
  2. Orange  
  3. Mango  

Checkbox. php file code

The instance code is as follows:

  1. ";
  2. Foreach ($ _ GET ["fruit"] as $ value)
  3. {Echo $ value ," ";
  4. }?>

The output result is

If you choose Orange and Mango

Note that $ _ GET is not suitable for obtaining a large amount of data. the length value cannot exceed 100 characters.

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.