Example #1
0
function prevPath(bool $isPath = true) : string
{
    if (!isset($_SERVER['HTTP_REFERER'])) {
        return false;
    }
    $str = str_replace(sslStatus() . host() . BASE_DIR . indexStatus(), '', $_SERVER['HTTP_REFERER']);
    if (currentLang()) {
        $str = explode("/", $str);
        return $str[1];
    }
    if ($isPath === true) {
        return $str;
    } else {
        $str = explode("/", $str);
        $count = count($str);
        if ($count > 1) {
            return $str[$count - 1];
        }
        return $str[0];
    }
}
function currentUri()
{
    if (BASE_DIR !== '/') {
        $cu = str_replace(BASE_DIR, '', server('requestUri'));
    } else {
        $cu = substr(server('requestUri'), 1);
    }
    if (indexStatus()) {
        $cu = str_replace(indexStatus(), '', $cu);
    }
    return $cu;
}
Example #3
0
function currentUri() : string
{
    $requestUri = server('requestUri');
    $currentUri = BASE_DIR !== '/' ? str_replace(BASE_DIR, '', $requestUri) : substr($requestUri, 1);
    if (indexStatus()) {
        $currentUri = str_replace(indexStatus(), '', $currentUri);
    }
    return $currentUri;
}
Example #4
0
function prevUrl() : string
{
    if (!isset($_SERVER['HTTP_REFERER'])) {
        return false;
    }
    $str = str_replace(sslStatus() . host() . BASE_DIR . indexStatus(), "", $_SERVER['HTTP_REFERER']);
    if (currentLang()) {
        $strEx = explode("/", $str);
        $str = str_replace($strEx[0] . "/", "", $str);
    }
    return siteUrl(internalCleanInjection($str));
}
Example #5
0
function currentUri()
{
    if (BASE_DIR !== '/') {
        $cu = str_replace(BASE_DIR, '', $_SERVER['REQUEST_URI']);
    } else {
        $cu = substr($_SERVER['REQUEST_URI'], 1);
    }
    if (indexStatus()) {
        $cu = str_replace(indexStatus(), '', $cu);
    }
    return $cu;
}