Home > php教程 > php手册 > PHP获取当前网址 域名

PHP获取当前网址 域名

WBOY
Release: 2016-06-13 10:46:40
Original
868 people have browsed it

 <br>
//获取当前的域名: <br>
echo SERVER['SERVER_NAME'];//获取来源网址,即点击来到本页的上页网址 <br>
echo SERVER["HTTP_REFERER"]; <br>
SERVER['REQUEST_URI'];//获取当前域名的后缀 <br>
SERVER['HTTP_HOST'];//获取当前域名 <br>
dirname(__FILE__);//获取当前文件的物理路径 <br>
dirname(__FILE__)."/../";//获取当前文件的上一级物理路径 <br>
?> <br>
<br>
摘自 Hurry的专栏						
Copy after login
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
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template