给大家一个webftp的地址,可以传zip文件
http://www.cqlc.net/webftp/
set_file("Update","update.html"); $t->set_file("Links","links.html"); $t->set_file("index","index.html"); //---设置循环,读取更新信息 $t ->set_block("Update","RowUpdate","RowsUpdate"); $tmp=array_reverse(file("./templates/data/update.ex")); for($i=0;$i $info[$i]=explode("||",$tmp[$i]); $t->set_var(array("Update"=>$info[$i][1],"UpdateTime"=>$info[$i][2])); $t->parse("Rows" name=description>
作者 Elliott 发布于 0000-00-00 分类:php基础编程
[PHP]
<?
include("./templates/template.inc");
$t=new template("./templates/");//模版文件开始
$t->set_file("Update","update.html");
$t->set_file("Links","links.html");
$t->set_file("index","index.html");
//---设置循环,读取更新信息
$t ->set_block("Update","RowUpdate","RowsUpdate");
$tmp=array_reverse(file("./templates/data/update.ex"));
for($i=0;$i
$t->set_var(array("Update"=>$info[$i][1],"UpdateTime"=>$info[$i][2]));
$t->parse("RowsUpdate","RowUpdate","true");
}
//---设置循环,读取链接信息
$t->set_block("Links","RowLinks","RowsLinks");
$tmplinks=file("./templates/data/links.ex");
for($i=0;$i
$t->set_var(array("link"=>$linksinfo[$i][1],"url"=>$linksinfo[$i][2]));
$t->parse("RowsLinks","RowLinks","true");
}
//---读取标题,版权信息
$other=file("./templates/data/other.ex");
$t->set_var(array("title"=>$other[0],"copyright"=>$other[1]));
$t->parse("PutNews","RowsUpdate");
$t->parse("PutLinks","RowsLinks");
$t->parse("out","index");
//$t->p("PutNews");
//$t->p("PutLinks");
$t->p("out");
?>
[/PHP]
能是能成功..但要写3个$t->set_file和3个$t_parse....
我看教程上就用array()可是实现,但我怎么试都只会出现一个橍目的内容.
哪位能帮我修改下吗?thanks
逛论坛交流:问一下各位PHPlib做循环输出时怎么做的?
0 条回复
回复