为什么老是显示register_1.htm内容?而registerType又显示正确

解决方案 »

  1.   

    if ($registerType="1")
    把"="换成"==" or "==="
      

  2.   

    <?phprequire_once("./include/global.php");
    require_once("./include/config.php");
    require_once("./include/function.php");
    require_once("./include/unt_db.php");
    require_once("./include/unt_template.php");ob_start();//-------------------------------------------------
    //   做一些初始化工作
    //  选择输出界面
    //-------------------------------------------------//$x_db = new TDB($main_host, $main_user, $main_password, $x_db_name);$registerType=$memtype;
    echo "传送来的"."$registerType";
    $t = new TTemplate($template_dir, 'keep');if ($registerType==1)
    {
    $tpl_file = "register_1.htm";
    }
    else if($registerType==2)
    {
    $tpl_file = "register_p.htm";
    }
    else{
    //$tpl_file = "register_1.htm";
    //$tpl_file = "register_p.htm";
    $tpl_file = "register_M.htm";
    }$t->set_file("main", $tpl_file);
    echo $tpl_file;
    //-------------------------------------------------
    //   显示
    //-------------------------------------------------//-------------------------------------------------
    //   设置常用变量并输出页面
    //-------------------------------------------------$t->set_var('self', $self);
    $t->parse('OUT', 'main');$t->p('OUT');
    ?>
    还是不行!
      

  3.   

    我用的是phplib里的模板类,如是你的类叫TTemplate那么请检查传入的变量是否正确,如果有变量传入,请确认它的值,如果值也是正确的那么检查一下所含模板文件是否正确。如果以上都没有问题,那么检查标点,如果标点也正确,那么看一下是否把registerType存到cookie或session中了。如果没有,那就没有办法了。问别人吧。
      

  4.   

    问题解决,是$registerType==“1”;