dongxun8189 2018-06-26 22:48
浏览 38

注意:未定义的索引:/home/webccans/public_html/index.php中的REDIRECT_URL

I am getting this error:

Notice: Undefined index: REDIRECT_URL in /home/webccans/public_html/index.php

I have Tried taking out the redirect and it still works. I need help try to define the index "REDIRECT_URL" I would appreciate and pointers or advice. The page is display, and the site works fine but this error is on the home page

This is the Code on my index page

<?
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');
?>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程
    • ¥30 Eclipse官网打不开,官网首页进不去,显示无法访问此页面,求解决方法
    • ¥15 关于smbclient 库的使用