PHP $_get get HTML form (form) or URL data _php tutorial

Source: Internet
Author: User
Tags html form learn php
Today I ate nothing to tell the story of a n years ago I learn PHP is to learn the use of global variables, the need to get started friends can refer to.

One, $_get is the data that gets the form method for get
Second, $_get get the data of url.php?i=12,
The above is the data we used to get the value using GET,

Example one, get the data of form

The code is as follows Copy Code

get.php

If I fill in a www.hzhuti.com

The code is as follows Copy Code

You are .


The output is

The code is as follows Copy Code

You are www.hzhuti.com

So what does the URL look like when we click submit?

The code is as follows Copy Code

Get.php?username=www.hzhuti.com

In this form, that is, the second way to get the data, let's take a look at the

/a.php?value=my

a.php

The code is as follows Copy Code

The value is .

The output is

The code is as follows Copy Code

Value is the My


This looks and form of method=get no difference, haha, well, the article is here.


Get also has a method, that is direct $_get so, what will be the form, see instance.

The code is as follows Copy Code


Apple

Orange

Mango


checkbox.php File Code

The code is as follows Copy Code

";
foreach ($_get["fruit"] as $value)
{echo $value, "
";
}?>

The output is


If you choose orange and mango


Note that $_get is not suitable for large data volume of the acquisition length value is not more than 100 characters.

Original station original tutorial reprint must indicate source: http://www.bKjia.c0m/phper/php.html

http://www.bkjia.com/PHPjc/629218.html www.bkjia.com true http://www.bkjia.com/PHPjc/629218.html techarticle today I ate nothing to tell the story of a n years ago I learn PHP is to learn the use of global variables, the need to get started friends can refer to. One, $_get is to get the table method for ...

  • 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.