GetRow($sql); if($rs[0]==""){ $template =& $manager->prepare("../template/error.html"); $tproc = new TemplateProcessor(); $message="该专家不存在!"; $tproc->set("message",$message); echo $tproc->process($template); exit; }else{ $manager = new TemplateManager(); $template =& $manager->prepare("../template/expert_detail-tmpl.html"); $tproc = new TemplateProcessor(); } $rs['category']=$category[$rs['cate']]; $rs['category_sub']=$category['sub_'.$rs['cate']][$rs['cate_sub']]; $rs['content']=nl2br($rs['content']); foreach($rs as $key =>$values){ $tproc->set($key,$values); } //$show_expert=file_get_contents("../".$rs[category]."专家.html"); $head=file_get_contents("../template/head.html"); $tproc->set("head", $head); $tproc->set("show_expert", $show_expert); echo $tproc->process($template); } ?>