php生成html的有关问题

WBOY
Release: 2016-06-13 13:35:54
Original
778 people have browsed it

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);
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!