1
0
mirror of https://github.com/php/web-php.git synced 2026-04-26 16:38:04 +02:00
Files
archived-web-php/manual-lookup.php
T
Gabor Hojtsy 8a28534c34 Manual lookup remake:
- use new type of includes
 - add base page functionality
 - use $_GET vars instead of register_globals
 - use existing information ($MQ, $LANG)
 - use mirror_redirect() for redirection
2003-08-08 13:46:28 +00:00

28 lines
873 B
PHP

<?php
// $Id$
$_SERVER['BASE_PAGE'] = 'manual-lookup.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/prepend.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/loadavg.inc';
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/manual-lookup.inc';
// BC code, so patter and function can equaly be used as
// parameters to specify the function name
if (empty($_GET['function']) && !empty($_GET['pattern'])) {
$_GET['function'] = $_GET['pattern'];
}
// Prepare data for search
if ($MQ) { $_GET['function'] = stripslashes($_GET['function']); }
$_GET['function'] = strtolower($_GET['function']);
// Try to find appropriate manual page
if ($file = find_manual_page($LANG, $_GET['function'])) {
mirror_redirect($file);
}
// Fall back to a quick reference search
$notfound = $_GET['function'];
include_once $_SERVER['DOCUMENT_ROOT'] . '/quickref.php';
?>