PHP retrieves the domain name of the current website. Prepreclassphpnamecode? Obtain the current domain name: echoSERVER [SERVER_NAME]; obtain the source URL, that is, click the previous URL echoSERVER [HTTP_REFERER]; SERVER [REQUEST_UR
// Obtain the current domain name:
Echo SERVER ['server _ name']; // Obtain the source URL, that is, click the previous URL on this page.
Echo SERVER ["HTTP_REFERER"];
SERVER ['request _ URI ']; // Obtain the suffix of the current domain name
SERVER ['http _ host']; // Obtain the current domain name
Dirname (_ FILE _); // Obtain the physical path of the current FILE
Dirname (_ FILE _). "/../"; // Obtain the upper-level physical path of the current FILE
?>
From Hurry's columnHttp://www.bkjia.com/PHPjc/478447.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478447.htmlTechArticle/prepre class = php name = code? // Obtain the current domain name: echo SERVER [SERVER_NAME]; // Obtain the source URL, that is, click the echo SERVER [HTTP_REFERER] on the previous page of this page; SERVER [REQUEST_UR...