php+smarty的系统为什么加载frameset页面 不显示呢?声明一下,BOM头已经检验过,HTML单独是正常的

解决方案 »

  1.   

    php页面:<?php
    /**
     * 
     */require_once('../global.ini.php');
    class ShowIndex extends CommonFrameWork {
    /**
     */
    var $obj_member;
    /**
     */
    var $obj_news;
    /**
     *
     */
    var $obj_product;
    /**
     *
     */
    var $obj_msg;
    /**
     *
     */
    var $obj_talk;
    function main(){
    $this->isLogin(); $this->SetSubTemplates('member'); if (!is_object($this->obj_member)){
    require_once('member.class.php');
    $this->obj_member = new MemberClass();
    }
    if (!is_object($this->obj_news)){
    require_once('news.class.php');
    $this->obj_news = new NewsClass();
    }
    if (!is_object($this->obj_product)){
    require_once('product.class.php');
    $this->obj_product = new ProductClass();
    }
    if (!is_object($this->obj_msg)){
    require_once('msg.class.php');
    $this->obj_msg = new MsgClass();
    }
    if (!is_object($this->obj_talk)){
    require_once('talk.class.php');
    $this->obj_talk = new TalkClass();
    }
    switch ($_GET['act']) {
    case 'top':
    $MemberArray = $this->obj_member->getMemberInfo(array('id'=>$_SESSION['user']['id']));
    $this->output('member_array',$MemberArray);
    $this->display('top');
    break;
    case 'left':
    $this->display('left');
    break;
    case 'main':
    $this->_main();
    break;
    default:
    $this->_default();
    break;
    }
    }
    function _main(){ $condition = array();
    $condition['member_id'] = $_SESSION['user']['id'];
    $product_array = $this->obj_product->getProductList($condition,'');
    if ($product_array){
    $this->output('product_count',count($product_array));
    } $condition = array();
    $obj_condition['to_id'] = $_SESSION['user']['id'];
    $msg_array = $this->obj_msg->getMsgList($obj_condition,'');
    if ($msg_array){
    $this->output('msg_count',count($msg_array));
    } $condition = array();
    $condition['to_member_id'] = $_SESSION['user']['id'];
    $talk_array = $this->obj_talk->getTalkList($condition,'');
    if ($talk_array){
    $this->output('talk_count',count($talk_array));
    }
    $MemberArray = $this->obj_member->getMemberInfo(array('id'=>$_SESSION['user']['id']));
    $this->output('member_array',$MemberArray);
    $this->display('main');
    }
    function _default(){
    //$this->isLogin();
    $MemberArray = $this->obj_member->getMemberInfo(array('id'=>$_SESSION['user']['id']));
    if ($MemberArray['photo'] != ''){
    $MemberArray['photo'] = $this->sys[site][url].$this->sys[upload][dir][root].$this->sys[upload][dir][photo].'/'.$MemberArray['photo'];
    }else{
    $MemberArray['photo'] = "../templates/images/gif/photo.gif";
    }
    $this->output('user_msg',strval($_SESSION['user']['msg']));
    if ($this->sys['space']['url_model'] == 1){
    $MemberArray['myurl'] = $this->sys['site']['url'].'/space/index.php?user='.$MemberArray['id'];
    }else{
    $MemberArray['myurl'] = $this->sys['site']['url'].'/space/index.php/'.$MemberArray['id'];
    }
    $this->output('MemberArray',$MemberArray);
    $this->display('index');
    }
    }$_showindex = new ShowIndex();
    $_showindex->main();
    unset($_showindex);
    ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>会员中心</title>
    </head><frameset rows="40,*" cols="*" frameborder="no" border="0" framespacing="0">
      <frame src="index.php?act=top" name="top" scrolling="No" noresize="noresize" id="top" title="topFrame" />
      <frameset cols="160,*" frameborder="no" border="0" framespacing="0">
        <frame src="index.php?act=left" name="leftFrame" scrolling="no" id="leftFrame" title="leftFrame" />
        
    <tpl> if $smarty.get.type eq 'receivelist'</tpl>
    <frame src="own_msg.php?act=receivelist" name="main" id="main" title="main" />
    <tpl> /if </tpl>
    <tpl> if $smarty.get.type eq 'sendlist'</tpl>
    <frame src="own_msg.php?act=sendlist" name="main" id="main" title="main" />
    <tpl> /if </tpl>
    <tpl> if $smarty.get.type eq 'add'</tpl>
    <frame src="own_product_add.php?act=add" name="main" id="main" title="main" />
    <tpl> /if </tpl>
      <tpl> if $smarty.get.type eq ''</tpl>
    <frame src="index.php?act=main" name="main" id="main" title="main" />
    <tpl> /if </tpl>
      <tpl> if $smarty.get.type eq 'pay'</tpl>
    <frame src="own_member.php?act=pay" name="main" id="main" title="main" />
    <tpl> /if </tpl>

      </frameset>
    </frameset>
    <noframes><body>
    </body>
    </noframes></html>
    声明一下,代码好像没问题,是否跟环境有关?比如操作系统,PHP版本等,请指点
      

  2.   

    没看到有    $_GET的 ($smarty.get.type) 传值的存在.
    而且 模板要用    if else if 的。..
      

  3.   

    你这边的  $_GET['type'] 由另个页面传过来的吗
      

  4.   

    这些代码在服务器上运行正常
    同样的代码 就这个FRAMESET就不正常 其他页正常
    单独打开里面包含的页面也正常 所以我就怀疑和环境有关
    我看到有关BOM的问题 我都修改过了 可是无效
      

  5.   

    直接输出 $smarty.get.type   看看值为什么
      

  6.   

    我说过了 看解析过的HTML源码是正常的
    但是就是无法显示出来FRAMESET这种类型的页面
      

  7.   

    用iframe吧,frame是用来搭框架的
      

  8.   

    用smarty开发的时候最好打开$smarty->error_report=all
    有什么错误直接就提示出来了。