一聚教程网:一个值得你收藏的教程网站

热门教程

php smarty 模板section入门教程与实例

时间:2022-06-25 01:01:45 编辑:袖梨 来源:一聚教程网

 代码如下 复制代码

include("smarty_inc.php");
include("config.php");

$rzlysql = "SELECT * FROM `log_reply`";
$rzlyr = mysql教程_query($rzlysql,$conn);
while($nam=mysql_fetch_array($rzlyr)){
$name[] = array("id" => $nam["id"], "info" => $nam["info"], "ip" => $nam["ip"], "time" => $nam["time"], "Reply" => $nam["Reply"] );
}
$smarty->assign("title",$name);
$smarty->display("index.html");

?>

然后是 index,html

 代码如下 复制代码

<{section name=y loop=$name}>
<{$title[y].id}> - <{$title[y].info}> - <{$title[y].ip}> - <{$title[y].time}> - <{$title[y].Reply}>
<{sectionelse}>
www.111com.net
<{/section}>

热门栏目