First, PHP gets the URL of the current page:
Copy the Code code as follows:
Get the current script URLfunction Getcururl (){if (!empty ($_server["Request_uri")){$scriptName = $_server["Request_uri"];$nowurl = $scriptName;}Else{$scriptName =
Here are some of the sorting, PHP to get the path of the small knowledge, hope to help you!
1,$_server["query_string") Description: Query string 2,$_server["Request_uri"] Description: The uri3,$_server["Script_name" required to access this page
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 retrieves the URL function instance of the current page and obtains the current url function. PHP retrieves the URL function instance of the current page. This article describes how PHP obtains the url function instance of the current page. The
Php retrieves the current url and replaces the parameter or url. First, PHP retrieves the URL of the current page: Copy the code as follows: get the current script URL functionGetCurUrl () {if (! Empty ($ _ SERVER [REQUEST_URI]) {$ scriptName $ _
The first is PHP to get the current page URL:
Copy Code code as follows:
Get the current script URL
function Getcururl ()
{
if (!empty ($_server["Request_uri"]))
{
$scriptName = $_server["Request_uri"];
$nowurl =
Php obtains the complete URL of the current page, and php obtains the current url. Php gets the complete URL of the current page. When php gets the current url and uses PHP to write programs, we often want to get the URL of the current page. The
This paper introduces the functions of getting the current URL path in PHP, and some server variables in PHP, which can be used for reference by friends in need.Mainly used in these several: $_server["query_string"],$_server["Request_uri"],$_server["
This article describes how PHP can obtain parameters such as the current host, domain name, URL, path, and port, if you are interested, please refer to this article. This article describes how PHP can obtain parameters such as the current host,
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.