Home  >  Article  >  Backend Development  >  How to get the addresses of the current page and the previous page in PHP?_PHP Tutorial

How to get the addresses of the current page and the previous page in PHP?_PHP Tutorial

WBOY
WBOYOriginal
2016-07-21 16:00:141073browse

$_SERVER['HTTP_REFERER'] //Get the address of the previous page
$_SERVER[PHP_SELF] //Get the address of the current page
$_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]." ?".$_SERVER["QUERY_STRING"] //This can get the address with parameters

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/317186.htmlTechArticle$_SERVER['HTTP_REFERER']//You can get the address of the previous page$_SERVER[PHP_SELF]//Get Current page address $_SERVER["HTTP_HOST"].$_SERVER["PHP_SELF"]."?".$_SERVER["QUERY_STRING"]//This can...
Statement:
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