Parse PHP to obtain the implementation code of the current URL and domain name_PHP tutorial

WBOY
Release: 2016-07-21 15:04:37
Original
788 people have browsed it

Copy code The code is as follows:

//Get the current domain name:
echo $_SERVER[' SERVER_NAME'];
//Get the source URL, that is, click to go to the previous page URL of this page
echo $_SERVER["HTTP_REFERER"];
$_SERVER['REQUEST_URI'];//Get the current The suffix of the domain name
$_SERVER['HTTP_HOST'];//Get the current domain name
dirname(__FILE__);//Get the physical path of the current file
dirname(__FILE__)."/../"; //Get the upper-level physical path of the current file
?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327754.htmlTechArticleCopy the code as follows: ? //Get the current domain name: echo $_SERVER['SERVER_NAME']; // Get the source URL, that is, click to go to the previous page URL of this page echo $_SERVER["HTTP_REFERER"]; $_SERVE...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template