搜尋
首頁後端開發php教程求助:php网站从windows平台移植到了Linux平台,出现导航的错误

php+mysql的网站,从原来的windows搭建的平台移植到了centos服务器的平台上,其他的都没有问题,就是主页导航看不到了,点了也不管用。
原来生成的主页代码:

  •  
       
      院情概况
      

          
    •  
         
        院情简介
        

              

         

    •  
      移植后生成的主页代码:
    •  
         
        " =$target?> =$select?>>=$data['title'];?>
        

            
      •  
           
          " =$target?>>=$data['title'];?>
          

                

           



      • 主页源代码:

        session_start();
        error_reporting(E_ALL ^ E_NOTICE);
        header('Content-Type: text/html; charset=utf-8');
        define('THISISADMINI',true);
        $dirName=dirname(__FILE__);
        $shlConfig=$dirName.'/config/dt-config.php';
        if(!is_file($shlConfig)||filesize($shlConfig)==0||filesize($shlConfig)==3)
        exit('SHLCMS系统尚未安装,请进入安装目录');
        else
        require($shlConfig);

        require(ABSPATH.'/loader/html.php');

        function_exists('date_default_timezone_set') && @date_default_timezone_set('Etc/GMT-'.TIMEZONENAME);
        require_once(ABSPATH.'/inc/class.database.php');
        require_once(ABSPATH.'/inc/function.php');

        $_REQUEST = cleanArrayForMysql($_REQUEST);
        $_GET     = cleanArrayForMysql($_GET);
        $_POST    = cleanArrayForMysql($_POST);
        $request  = $_REQUEST;
        $menu_arr=array();
        //写路由语句
        $pfileName = $request['f'];
        if(!empty($pfileName) && $pfileName != 'search')
        $request['p'] = getIdByMenuName($pfileName);
        elseif($pfileName == 'search')
        $request['m'] = 'search';

        $params['id'] = $request['p'] =isset($request['p'])?intval($request['p']):0;
        $params['cid'] = $request['c'] =isset($request['c'])?intval($request['c']):0;
        $params['args'] = $request['r'] =isset($request['r'])?intval($request['r']):0;
        $params['i'] = $request['i'] =isset($request['i'])?intval($request['i']):0;
        $request['comment'] =isset($request['comment'])?intval($request['comment']):0;
        $request['mdtp'] =isset($request['mdtp'])?intval($request['mdtp']):0;
        $menu_arr=get_model_type($params['id']);

        $request['m'] = !isset($request['m'])?'':$request['m'];
        $params['model'] = empty($request['m'])?$menu_arr['type']:$request['m'];
        $request['a'] = !isset($request['a'])?'':$request['a'];
        $params['action'] = empty($request['a'])?'index':$request['a'];
        $params['related_common']= empty($menu_arr['related_common'])?$params['model']:$menu_arr['related_common'];

        if($params['model']!='user' || $params['model']!='index')
        {
        $model_arr=array( 'article' , 'guestbook' , 'jobs' , 'order' , 'webmap' , 'poll','download');
        if(intval($_SESSION[TB_PREFIX.'user_roleId']) {
        URLREWRITE?redirect('/login.html'):redirect('./?m=user&a=login&url='.urlencode($_SERVER['REQUEST_URI']));exit();
        }
        }
        $loadFile=array(
        0=>'/inc/common.php',
        1=>'/inc/class.pager.php',
        2=>'/inc/class.treemenu.php',
        3=>'/content/common/common.php',
        4=>'/inc/class.seo.php',
        5=>'/config/dt-global.php',
        6=>'/content/index/common_call_label.php',
        7=>'/content/index/old_call_label.php'
        );
        foreach($loadFile as $k=>$v){
        require_once(ABSPATH.$v);
        }
        unset($loadFile);
        $controller=ABSPATH.'/content/'.$params['model'].'/index.php';
        if(is_file($controller))
        {
        require_once($controller);
        require_once(ABSPATH.'/content/comment/index.php');

        //执行 Action
        empty($params['action'])?index():(function_exists($params['action'])?$params['action']():exit("无此Action #".RemoveXSS($params['action'])." 或栏目类型已被修改"));
        }
        $part_path=ABSPATH.'/skins/'.STYLENAME.'/';
        $part_common_path=ABSPATH.'/skins/'.STYLENAME.'/common/';
        $loadSkinIndex=$part_path.'index.php';
        $loadSkinCommon=$part_path.'common.php';
        $loadSkinOtherCommon=$part_common_path.$params['related_common'];

        switch ($params['related_common'])
        {
        case 'index':
        if(is_file($loadSkinIndex))require_once($loadSkinIndex);
        break;
        default:
        if(is_file($loadSkinOtherCommon)) 
        require_once($loadSkinOtherCommon);
        elseif(is_file($loadSkinCommon))
        require_once($loadSkinCommon);
        else
        exit ('pager error!');
        break;
        }

        function sys_layout_part($style='')
        {
        global $request,$params,$tag,$path,$data;


        if(!empty($style)) $style = '_'.$style;
        $part_path=ABSPATH.'/skins/'.STYLENAME.'/parts/'.$params['model'].'_'.$params['action'].$style.'.php';
        $content_part_path=ABSPATH.'/content/'.$params['model'].'/parts_'.$params['action'].'.php';
        if(is_file($part_path))
        require_once($part_path);
        elseif(is_file($content_part_path))
        require_once($content_part_path);
        else 
        echo '';


        isComments();
        }
        function get_model_type($id)
        {
        global $db;
        if($id==0)
        return array('type'=>'index','level'=>0);
        else
        return $db->get_row("SELECT * FROM ".TB_PREFIX."menu WHERE id=$id",ARRAY_A);
        }
        //new 2011.01.08
        function getIdByMenuName($file)
        {
        global $db;
        $sql="SELECT id FROM ".TB_PREFIX."menu WHERE menuName='$file'";
        return $db->get_var($sql);
        }
        unset($request);
        unset($params);
        unset($tag);
        unset($path);
        unset($data);
        ?>


        回复讨论(解决方案)

        还需要哪些代码我可以随后贴上

        原环境
        short_open_tag = On
        新环境
        short_open_tag = Off

        不支持短标记了,所以
         " =$target?>>=$data['title'];?>
        中的短标记php代码未被执行

        谢谢版主了,高手就是高手!

  • 陳述
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
    解釋負載平衡如何影響會話管理以及如何解決。解釋負載平衡如何影響會話管理以及如何解決。Apr 29, 2025 am 12:42 AM

    負載均衡會影響會話管理,但可以通過會話複製、會話粘性和集中式會話存儲解決。 1.會話複製在服務器間複製會話數據。 2.會話粘性將用戶請求定向到同一服務器。 3.集中式會話存儲使用獨立服務器如Redis存儲會話數據,確保數據共享。

    說明會話鎖定的概念。說明會話鎖定的概念。Apr 29, 2025 am 12:39 AM

    Sessionlockingisatechniqueusedtoensureauser'ssessionremainsexclusivetooneuseratatime.Itiscrucialforpreventingdatacorruptionandsecuritybreachesinmulti-userapplications.Sessionlockingisimplementedusingserver-sidelockingmechanisms,suchasReentrantLockinJ

    有其他PHP會議的選擇嗎?有其他PHP會議的選擇嗎?Apr 29, 2025 am 12:36 AM

    PHP會話的替代方案包括Cookies、Token-basedAuthentication、Database-basedSessions和Redis/Memcached。 1.Cookies通過在客戶端存儲數據來管理會話,簡單但安全性低。 2.Token-basedAuthentication使用令牌驗證用戶,安全性高但需額外邏輯。 3.Database-basedSessions將數據存儲在數據庫中,擴展性好但可能影響性能。 4.Redis/Memcached使用分佈式緩存提高性能和擴展性,但需額外配

    在PHP的上下文中定義'會話劫持”一詞。在PHP的上下文中定義'會話劫持”一詞。Apr 29, 2025 am 12:33 AM

    Sessionhijacking是指攻擊者通過獲取用戶的sessionID來冒充用戶。防範方法包括:1)使用HTTPS加密通信;2)驗證sessionID的來源;3)使用安全的sessionID生成算法;4)定期更新sessionID。

    PHP的完整形式是什麼?PHP的完整形式是什麼?Apr 28, 2025 pm 04:58 PM

    文章討論了PHP,詳細介紹了其完整形式,在We​​b開發中的主要用途,與Python和Java的比較以及對初學者的學習便利性。

    PHP如何處理形式數據?PHP如何處理形式數據?Apr 28, 2025 pm 04:57 PM

    PHP使用$ \ _ post和$ \ _獲取超級全局的php處理數據,並通過驗證,消毒和安全數據庫交互確保安全性。

    PHP和ASP.NET有什麼區別?PHP和ASP.NET有什麼區別?Apr 28, 2025 pm 04:56 PM

    本文比較了PHP和ASP.NET,重點是它們對大規模Web應用程序,性能差異和安全功能的適用性。兩者對於大型項目都是可行的,但是PHP是開源和無關的,而ASP.NET,

    PHP是對病例敏感的語言嗎?PHP是對病例敏感的語言嗎?Apr 28, 2025 pm 04:55 PM

    PHP的情況敏感性各不相同:功能不敏感,而變量和類是敏感的。最佳實踐包括一致的命名和使用對案例不敏感的功能進行比較。

    See all articles

    熱AI工具

    Undresser.AI Undress

    Undresser.AI Undress

    人工智慧驅動的應用程序,用於創建逼真的裸體照片

    AI Clothes Remover

    AI Clothes Remover

    用於從照片中去除衣服的線上人工智慧工具。

    Undress AI Tool

    Undress AI Tool

    免費脫衣圖片

    Clothoff.io

    Clothoff.io

    AI脫衣器

    Video Face Swap

    Video Face Swap

    使用我們完全免費的人工智慧換臉工具,輕鬆在任何影片中換臉!

    熱工具

    EditPlus 中文破解版

    EditPlus 中文破解版

    體積小,語法高亮,不支援程式碼提示功能

    SublimeText3漢化版

    SublimeText3漢化版

    中文版,非常好用

    WebStorm Mac版

    WebStorm Mac版

    好用的JavaScript開發工具

    ZendStudio 13.5.1 Mac

    ZendStudio 13.5.1 Mac

    強大的PHP整合開發環境

    SublimeText3 Mac版

    SublimeText3 Mac版

    神級程式碼編輯軟體(SublimeText3)