Predefined variables PHP

巴扎黑
Release: 2016-11-24 10:09:26
Original
884 people have browsed it

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

$_ENV: http://www.php.net/manual/zh/reserved.variables.environment. The data in php

$_POST and $_GET can be obtained through $_REQUEST, but $_REQUEST will be slower than $_GET and $_POST.

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

$_COOKIE and $_SESSION are used for session control.

In addition, if you want to customize the value in $_SERVER, you only need to add some commonly used variables (mostly used in clusters) in fastcgi_params. Add the following codes:

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 in $_SERVER["DB4_USER"] root.


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!