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 =
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"], $ _
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 get URL parameter method summary, PHP get URL parameter
The example in this article describes how PHP gets URL parameters. Share to everyone for your reference. Specific as follows:
In PHP, there are many ways to get the parameters in the URL,
How does the PHP tutorial CMS support Chinese path? Phpcms Chinese URL How to set it?
I'm going to come down here.
First, in the phpcms include directory, there are global.func.php files.
The function createhtml ($file) is
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["
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 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 $ _
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.