Reserved variable PHP

Source: Internet
Author: User
Predefine variable PHP note :? $ _ SERVER: www. php. netmanualzhreserved. variables. server. php $ _ ENV: www. php. netmanualzhreserved. variables. environment. php? $ _ POST, $ _ GET's predefined variable PHP

Note:

?

$ _ SERVER: http://www.php.net/manual/zh/reserved.variables.server.php

$ _ ENV: http://www.php.net/manual/zh/reserved.variables.environment.php

?

$ _ POST and $ _ GET can all be obtained through $ _ REQUEST, but $ _ REQUEST is slower than $ _ GET and $ _ POST.

$ _ FILE: FILE upload, the http://www.php.net/manual/zh/features.file-upload.post-method.php only has data when uploading files in POST. Refer to Example #3 on the help page.

$ _ COOKIE and $ _ SESSION are used for SESSION control.

?

In addition, to customize the value in $ _ SERVER, you only need to add some common variables (mostly used for clusters) in fastcgi_params ). Add the following code:

Fastcgi_param? DB4_USER ?? Root;
Fastcgi_param? DB4_PASS? ? "";
Fastcgi_param? DB4_HOST ?? Localhost;
Fastcgi_param? DB4_PORT ?? 3306;
Fastcgi_param? DB4_NAME ?? Test;

?

Then, get the current environment variable value root in $ _ SERVER ["DB4_USER.

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.