Get URL parameters

Source: Internet
Author: User

Example:

1,http://localhost/aaa/(Open index.php in AAA)
Results:
$_server[' query_string '] = "";
$_server[' Request_uri '] = "/aaa/";
$_server[' script_name '] = "/aaa/index.php";
$_server[' php_self '] = "/aaa/index.php";

2,http://localhost/aaa/?p=222 (with inquiry)
Results:
$_server[' query_string '] = "p=222";
$_server[' Request_uri '] = "/aaa/?p=222";
$_server[' script_name '] = "/aaa/index.php";
$_server[' php_self '] = "/aaa/index.php";

3,http://localhost/aaa/index.php?p=222&q=333
Results:
$_server[' query_string '] = "p=222&q=333";
$_server[' Request_uri '] = "/aaa/index.php?p=222&q=333";
$_server[' script_name '] = "/aaa/index.php";
$_server[' php_self '] = "/aaa/index.php";

By example:
$_server["Query_string"] gets the query statement, in the instance, gets the following value
$_server["Request_uri"] gets the value after http://localhost, including/
$_server["Script_name"] gets the path to the current script, such as: index.php
$_server["Php_self"] The file name of the script that is currently executing

Get URL parameters

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.