Home  >  Article  >  Backend Development  >  php生成html的有关问题

php生成html的有关问题

WBOY
WBOYOriginal
2016-06-13 10:15:32675browse

php生成html的问题
目前是动态的。怎么写生成html . 模板和程序是分离的

$sql="select * from dede_archives" ;
$res=mysql_query($sql);
$row=mysql_query_fetch($res);

$row[title] $row[content] …… 很多个值。





怎么样把这个结果写到 指定的模板 (模板已有样式 show.htm )



------解决方案--------------------

探讨
目前是动态的。怎么写生成html . 模板和程序是分离的

$sql="select * from dede_archives" ;
$res=mysql_query($sql);
$row=mysql_query_fetch($res);

$row[title] $row[content] …… 很多个值。

怎么样把这个结果写到 指定的模板 (模板已有样式 show.htm )

------解决方案--------------------
define('INTSIDE_CATALOG_ROOT', '本地URL');
foreach ($date as $rows)
{
$html.='';
$html.='php生成html的有关问题';
$html.='
';
}
$open=fopen(INTSIDE_CATALOG_ROOT.$var_name_sql[0]['Type_varname'].'.html',"w+");
$write_in=fwrite($open,$html);
if ($write_in==false){
$mg=$var_name_sql[0]['Type_varname'].'文件生成失败';//向日志中添加数据
Log_File::writeAppwwwadminLog($mg);
}
fclose($open);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn