コード例 #1
0
ファイル: error.php プロジェクト: sandsmedia/web-php
    status_header(200);
    include_once $_SERVER['DOCUMENT_ROOT'] . "/{$URI}.php";
    exit;
}
// ============================================================================
// Try to find the page using the preferred language as a manual page
include_once $_SERVER['DOCUMENT_ROOT'] . "/include/manual-lookup.inc";
$try = find_manual_page($LANG, $URI);
if ($try) {
    status_header(200);
    include_once $_SERVER['DOCUMENT_ROOT'] . $try;
    exit;
}
// BC. The class methods are now classname.methodname
if (preg_match("!^manual/(.+)/function\\.(.+)-(.+).php\$!", $URI, $array)) {
    $try = find_manual_page($array[1], $array[2] . "." . $array[3]);
    if ($try) {
        status_header(301);
        mirror_redirect($try);
        exit;
    }
}
// ============================================================================
// 404 page for manual pages (eg. not built language)
if (strpos($URI, "manual/") === 0) {
    error_404_manual();
}
// ============================================================================
// If no match was found till this point, the last action is to start a
// search with the URI the user typed in
$fallback = myphpnet_urlsearch() === MYPHPNET_URL_MANUAL ? "404manual" : "404quickref";
コード例 #2
0
ファイル: index.php プロジェクト: phpsource/web-gtk
// name and protocol.
$uri = substr($REDIRECT_REDIRECT_ERROR_NOTES, strpos($REDIRECT_REDIRECT_ERROR_NOTES, $_SERVER['DOCUMENT_ROOT']) + strlen($_SERVER['DOCUMENT_ROOT']) + 1);
# try to find the uri as a manual entry
require "manual1-lookup.inc";
// Check to see if the URI has a '/' in it. If it does then a page like
// .../en/show_all was requested.
if (strchr($uri, '/')) {
    // Break the URI up into language and page.
    list($lang, $function) = explode('/', $uri, 2);
    $function = strtolower($function);
    $lang = strtolower($lang);
} else {
    $function = strtolower($uri);
}
// Check to see if there is a manual page for the language and function.
$try = find_manual_page($lang, $function);
if ($try) {
    // Send a redirect header.
    header("HTTP/1.0 302 Redirect");
    // Send the redirect location.
    header("Location: {$try}");
    exit;
}
# If all else fails ... redirect to the search page with the pattern set to $_SERVER['REQUEST_URI']
#if ($_SERVER['REQUEST_URI']) {
#	header('HTTP/1.0 302 Redirect');
#	header('Location: /search.php?show=nosource&pattern='.urlencode($_SERVER['REQUEST_URI']) );
#	exit;
#}
make404();
exit;
コード例 #3
0
$_SERVER['BASE_PAGE'] = 'manual-lookup.php';
include $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
include $_SERVER['DOCUMENT_ROOT'] . '/include/manual-lookup.inc';
// BC code, so pattern and function can both be used as
// parameters to specify the function name
$function = '';
if (!empty($_GET['function']) && is_string($_GET['function'])) {
    $function = htmlspecialchars($_GET['function'], ENT_QUOTES, 'UTF-8');
} elseif (!empty($_GET['pattern']) && is_string($_GET['pattern'])) {
    $function = htmlspecialchars($_GET['pattern'], ENT_QUOTES, 'UTF-8');
}
if (!empty($_GET['scope']) && is_string($_GET['scope'])) {
    $scope = htmlspecialchars($_GET['scope'], ENT_QUOTES, 'UTF-8');
} else {
    $scope = '';
}
// Prepare data for search
if ($function) {
    if ($MQ) {
        $function = stripslashes($function);
    }
    $function = strtolower($function);
    // Try to find appropriate manual page
    if ($file = find_manual_page($LANG, $function)) {
        mirror_redirect($file);
    }
}
// Fall back to a quick reference search
$notfound = $function;
include $_SERVER['DOCUMENT_ROOT'] . '/quickref.php';
コード例 #4
0
ファイル: manual1-lookup.php プロジェクト: phpsource/web-gtk
                        echo "?";
                    }
                    echo "</P>";
                }
            }
        }
    }
    echo "<br><a href={$_SERVER['HTTP_REFERER']}>Back</a>";
    commonFooter();
}
$function = strtolower($_GET['function']);
if (strlen($function) < 3) {
    make404($lang);
    exit;
}
$file = find_manual_page($lang, $function);
if (is_array($file)) {
    if (sizeof($file) < 2) {
        $file = strtolower($file[0]);
        if (strpos($file, "pt_br")) {
            $file = str_replace("pt_br", "pt_BR", $file);
        }
        header("Location: http://{$_SERVER['HTTP_HOST']}{$file}");
        exit;
    }
    multi_choice($file, $lang);
    exit;
} elseif ($file && !is_array($file)) {
    $file = strtolower($file);
    if (strpos($file, "pt_br")) {
        $file = str_replace("pt_br", "pt_BR", $file);