Home > Backend Development > PHP Tutorial > PHP gets the current URL domain name_PHP tutorial

PHP gets the current URL domain name_PHP tutorial

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-07-13 17:48:09
Original
1061 people have browsed it


//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 suffix of the current 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
?>

Excerpted from Hurry’s column

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/478447.htmlTechArticle/prepre class=php name=code? //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_UR...
Related labels:
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template