smarty生成静态的问题
include("1.php");//引用1.php页面里面的配置////$a1[]=array("name"=>"标题1","date"=>"时间咯1");//$a1[...
include("1.php");//引用1.php页面里面的配置
//
//$a1[]=array("name"=>"标题1","date"=>"时间咯1");
//$a1[]=array("name"=>"标题2","date"=>"时间咯2");
//$a1[]=array("name"=>"标题3","date"=>"时间咯3");
//$a=array("name","d3","date","f中国3");
$a=mysql_connect("127.0.0.1:3306","root","");
mysql_query("set names gb2312");
$hg="select * from ok where di_zi='xxx.html' order by id desc limit 0,10";//order by id desc limit 0,10
$lwbm=mysql_db_query("jie",$hg,$a);
while($ds=mysql_fetch_array($lwbm)){
$a1[]=array("name"=>"$ds[di_zi]","date"=>"$ds[name]");
$smarty->assign("ok1",$a1);
}
//$smarty->assign("ok1","dfdf"); //ok是index.html页面的要替换咯
//$smarty->assign("ok",$a); //ok是index.html页面的要替换咯
$smarty->display("index.html");
上面的页面我都写好了.就是在保存输出的页面的时候不会..要怎么样写呢..还有.如果是很多个页面要保存要怎么样写.是不是要写一个类?要怎么样写..谢谢指点一下 展开
//
//$a1[]=array("name"=>"标题1","date"=>"时间咯1");
//$a1[]=array("name"=>"标题2","date"=>"时间咯2");
//$a1[]=array("name"=>"标题3","date"=>"时间咯3");
//$a=array("name","d3","date","f中国3");
$a=mysql_connect("127.0.0.1:3306","root","");
mysql_query("set names gb2312");
$hg="select * from ok where di_zi='xxx.html' order by id desc limit 0,10";//order by id desc limit 0,10
$lwbm=mysql_db_query("jie",$hg,$a);
while($ds=mysql_fetch_array($lwbm)){
$a1[]=array("name"=>"$ds[di_zi]","date"=>"$ds[name]");
$smarty->assign("ok1",$a1);
}
//$smarty->assign("ok1","dfdf"); //ok是index.html页面的要替换咯
//$smarty->assign("ok",$a); //ok是index.html页面的要替换咯
$smarty->display("index.html");
上面的页面我都写好了.就是在保存输出的页面的时候不会..要怎么样写呢..还有.如果是很多个页面要保存要怎么样写.是不是要写一个类?要怎么样写..谢谢指点一下 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询