PHP文件原代码:
include_once("./comm/Smarty.class.php"); //包含smarty类文件
define("NUM", 5); //定义每次显示的新闻条数
$smarty = new Smarty(); //建立smarty实例对象$smarty
$smarty->templates_dir = "./templates"; //设置模板目录
$smarty->compile_dir = "./templates_c"; //设置编译目录
$smarty->cache_dir = "./cache"; //设置缓存目录
$smarty->cache_lifetime = 60 * 60 * 24; //设置缓存时间
$smarty->caching = false; //这里是调试时设为false,发布时请使用true
$smarty->left_delimiter = "<{"; //设置左边界符
$smarty->right_delimiter = "}>"; //设置右边界符
$db=mysql_connect('localhost','root','123456');
mysql_select_db('liu',$db);
$sql="select id,title from lyb";
mysql_query("set names gb2312");
$result=mysql_query($sql,$db);
while($row=mysql_fetch_array($result)){
$array[]=array("id"=>$row['id'],
"title"=>$row['title']);
}
mysql_close();
$smarty->assign('new',$array);
$smarty->display('3.html');
?>
3.html
<{section name=loop loop=$new}> <{$new[loop].id}> <{$new[loop].title}> <{/section}> |
樱花校园模拟器4399中文版
樱花校园模拟器4399中文版,十分奇趣好玩的3d校园冒险模拟
我的暑假秘密回忆繁星新春版
我的暑假秘密回忆繁星新春版是一款少女模拟养成类休闲游戏。这款
樱花校园模拟器国际版
樱花校园模拟器国际版,一个超级自由超级好玩的自由恋爱模拟的游
饥荒海难九游版
饥荒海难九游版,带你去真实的海岛上感受一下什么才是真正的孤岛
盖瑞模组体验版最新版
盖瑞模组体验版是玩法非常丰富多元化的沙盒建造游戏,玩家可以在