Notice: Undefined index: in C:\wamp\www\new09\system\compile\76c81b74e5c331134741df9f50203e43f8ab112b.file.new_list.tpl.php on line 78视图代码:{section name=arr loop=$rst2 max=10 start=0}
{if $smarty.section.arr.index<10 }
<li><a href="new_con.php?&id={$rst2[arr].news_id}&ntr={$rst2[arr].news_type}" title="{$rst2[arr].news_title}">{$rst2[arr].news_title}</a></li>
{/if}
{/section}逻辑控制代码:<?php
require_once('include.php');
$ntr=$_GET["ntr"];
if(isset($_GET['ntr']) && isset($_GET['page'])){
$page=$_GET['page'];
$ntr=$_GET['ntr'];
}else{
$ntr="";
$page=1;
}
$sql = $seppage->ShowData("select * from tb_news",$conn,10,$page);
$sql2="select * from tb_news where news_type={$ntr} order by news_date DESC";
$rst2 = $admindb->ExecSQL($sql2,$conn);
$smarty->assign("formarr",$sql);
$smarty->assign('showpage',$seppage->ShowPage($ntr,'',"a"));
$arrtype=array("","新闻动态","科研成果","工学结合","学生工作");
$smarty->assign('arrtype',$arrtype);
$smarty->assign('ntr',$ntr);
$smarty->assign('rst2',$rst2);
$smarty->display('new_list.tpl');
//echo $arrtype[4];
?>
添加回答
举报
0/150
提交
取消