array CMain::GetSiteByDir( mixed path = false, mixed host = false )
The method GetSiteByDir returns an array describing the site defined by the specified path and domain. The method uses the following algorithm.
Parameter | Description |
---|---|
path | Path relative to the root . Optional; the default value is the path to the current page. |
host | Domain name. Optional; the default value is the current domain. |
Array describing the site with keys described in the CSite fields section.
<? // obtain the referrer URL, or the last URL of the current session if (strlen($_SERVER["HTTP_REFERER"])<=0) $referer_url = $_SESSION["SESS_HTTP_REFERER"]; else $referer_url = $_SERVER["HTTP_REFERER"]; // parse URL to get the domain and page $arUrl = parse_url($referer_url); // obtain the site descriptor array $arSite = $APPLICATION->GetSiteByDir($arUrl["path"], $arUrl["host"]); ?>
© 2001-2005 Bitrix | Bitrix Site Manager - Content Management & Portal Solutions |