zshtom
中级会员
 
初级会员
UID 66877
精华
0
积分 249
帖子 308
金钱 249 喜悦币
威望 0
人脉 0
阅读权限 30
注册 2005-9-23
状态 离线
|
[广告]: 代充Paypal帐号美元
求助smarty高手
求助smarty高手 模板tpl可以嵌套不 要是用<{include file="*.tpl"}>
嵌套了的话 为什么
Notice: Undefined index: news in e:\program files\easyphp1-8\www\job1\templates_c\%%22^224^224D2A2F%%1.tpl.php on line 5
1.tpl
<{section name=loop loop=$news}>
>
<a href=shownews.php?id=<{$news[loop].id}>><{$news[loop].title}></a>
<br>
<{/section}>
1.php
<?
require "config.php";
$sql = "select * from news where type='1'";
$query = mysql_query($sql);
if(mysql_num_rows($query)==0)
{
echo "¶Ô²»ÆðÊý¾Ý¿âÖÐûÓÐÊý¾Ý£¡";
}
while($array1=mysql_fetch_array($query))
{
$array[]=array("id"=>$array1["Id"], "title"=>$array1["title"]);
}
$smarty->assign("news", $array);
$smarty->display("1.tpl");
?>
其中1.tpl被另外的middle.tpl引用
middle.php中用包含1.php吗 怎么解决出现乱码问题
小弟先谢谢了
|
|