我收到此错误:
通知:未定义的索引:/home/webccans/public_html/index.php中的REDIRECT_URL
我尝试了重定向,但它仍然有效。我需要帮助来尝试定义索引“ REDIRECT_URL”,以及相关的指针或建议。 显示页面,站点工作正常,但此错误在主页上
这是我的索引页上的代码
<?
include('application.php');
$header = false;
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
if (($request = trim($_SERVER['REDIRECT_URL'])) == '') {
// Deal with direct requests
$Page = (isset($_GET['Page'])) ? $_GET['Page'] : 1;
$Page = $CMS->getPageContent($Page);
} else {
// Deal with "friendly" URL 404 pages
$pages = explode('/', $request);
array_shift($pages);
$page = array_pop($pages);
if (($pos = strpos($page, '.')) === false) {
$ext = '';
} else {
$ext = substr($page, strpos($page, '.'));
if ($pos = strpos($ext, '?')) $ext = substr($ext, 0, $pos);
}
if ($page == '') {
// have a CMS page or the home page
} else if ($ext == '.htm' || $ext == '.html' || $ext == '.php') {
$PageURL = substr($page, 0, strlen($ext) * -1);
if ($PageURL != "index") {
// Possible have a CMS page
array_push($pages, $PageURL);
}
} else if ($ext == '') {
// have a CMS page
array_push($pages, $page);
} else {
$CMS->show404Page();
$header = true;
}
if (($numPages = count($pages)) > 0) {
// Get PageID
$select = 'SELECT ';
$from = ' FROM site_content AS page0 LEFT JOIN site_content AS
page ON (page0.ParentID = page.PageID) ';
$where = ' WHERE (page0.ParentID = 0 OR page.Display = 0) ';
for ($idx = 0; $idx < $numPages; ++$idx) {
$where .= ' AND ';
if ($idx > 0) {
$select .= ', ';
$from .= ' JOIN site_content AS page' . $idx . ' ON (page'
. ($idx - 1) . '.PageID = page' . $idx . '.ParentID)';
}
$select .= 'page' . $idx . '.PageID ';
$where .= 'page' . $idx . '.PageURL = "' . $DB-
>escape(strtolower($pages[$idx])) . '"';
#$select1 = 'page' . $idx . '.PageID ';
}
$qid = $DB->query($select . $from . $where);
if ($row = $DB->fetchRow($qid)) {
$PageID = $row[$numPages - 1];
$OpenedPages = $row;
#print_r ($row);
}
else {
$CMS->show404Page();
$header = true;
}
} else {
$PageID = 1;
}
$Page = $CMS->getPageContent($PageID);
#echo '<script language="javascript">' . 'alert("' . $PageID . '")'
.
'</script>';
#echo '<script language="javascript">' . 'alert("' . $ParentId . '")'
. '</script>';
}
$TopPage = $CMS->getTopParent($Page->PageID);
if (!$header) header('HTTP/1.1 200 OK');
?>