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

How to get the address of the current page and the previous page in PHP?

WBOY
WBOYOriginal
2016-07-29 08:35:211203browse

$_SERVER['HTTP_REFERER'] //You can 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

The above introduces how to get the address of the current page and the previous page in PHP, "The person who gets you, but I can't get your heart" lyrics, including the content of the lyrics of "The person who gets you, but I can't get your heart". I hope it will be helpful to PHP. Tutorials are helpful for those who are interested.

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