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 =
How can I get the url of the previous page? I use header (Location :.. index. php) jump to index. for php, how can I obtain the url of the page before the jump? it seems impossible to use $ _ SERVER [HTTP_REFERER. ------ Solution ------------------
PHP $_server[' Http_referer ']Using $_server[' Http_referer '] will make it easy to get the address of the previous page linked to the current page. An example is as follows:index.php (actual address: http://www.5idev.com/php/index.php): Links
Reprint: http://www.5idev.com/p-php_server_http_referer.shtmlUsing $_server[' Http_referer '] will make it easy to get the address of the previous page linked to the current page. An example is as follows:index.php (actual address:
First, JS gets the URL address of the previous access page Document.referrerTo get the URL address of the previous access page the front and back languages are available, for example PHP is $_SERVER[‘HTTP_REFERER‘] , JavaScript is document.referrer .
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 $ _
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.