PHP obtains the path, name, and server path of the file running before the current period. & lt ;? Phpecho displays the relative path and file name of the script file :. $ _ SERVER [PHP_SELF]. & lt; br & gt; echo display the CGI script
Php obtains the php server variable in the current url path.
Programming in php to obtain the current url address and server variables mainly uses the following global variables: $ _ server ["query_string"], $ _ server ["request_uri"], $ _
PHP obtains the path, name, and server path of the file running before the current period. & lt ;? Phpecho "shows the relative path and file name of the script file :\"". $ _ SERVER ["PHP_SELF"]. "\" & lt; br & gt; "; echo" display the CGI script
Use absolute and relative paths in php. Let's take a look at two pieces of code: Code 1: Access [php] metahttp-equivContent-Typecontenttexthtml; charsetGBK? Phpecho $ _ SERVER [DOCUMENT_ROOT];? The imgsrc..1.jpg code is as follows:
Code 1: access
PHP Tutorial Configuration Chinese Narration
Let's see what you see, php.ini.
[PHP]
;;;;;;;;;;;; WARNING;;;;;;;;;;;;; This is the default settings file for new PHP installations.; By default, PHP installs itself with a configuration suitable for;
Suppose there is an array: What will the above code output? Above results you can try again locally. We generally use Print_r to print an array (of course with var_dump, but not structurally clear) bool Print_r (mixed $expression [, BOOL $return])
PHP gets the path, name, and server path of the running file before the current period
echo "Displays the relative path and file name of the script file: \" ". $_server[" Php_self "]." \"";echo "Displays the CGI script specification used by the
Today, my colleague suddenly told me that the execution of a PHP script I wrote was always unsuccessful.
The script itself is simple, it contains only a few library files and executes a function, the function should have no errors, this function
For a php://input introduction, the PHP Official Handbook document has a very clear overview of it.
"Php://input allows to read raw POST data. It is a less memory intensive alternative to $HTTP _raw_post_data and does no need any special php.ini.
The security practice of PHP, which must be known by system administrators, is an open source server scripting language and widely used. The Apacheweb server provides the convenience of accessing files and content through HTTP or HTTPS. Improper
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.