本文章是利用了php的fso功能读取模板文件,然后根据我处自定义好的标签进行了文件模板替换就ok了。
本文章是利用了php的fso功能读取模板文件,然后根据我处自定义好的标签进行了文件模板替换就ok了。
function GetContent($type){
if( $type )
{
if(file_exists('./mail_room.html') )
{
$content = file_get_contents( './mail_room.html');
}
else
{
ShowMsg('file can' read fail ');
}
}
else
{
if( file_exists( './mail_person.html') )
{
$content = file_get_contents( './mail_person.html');
}
else
{
ShowMsg('person file read fail!');
}
}
return $content;
}
function template($str)
{
$_url = $_SERVER['HTTP_HOST'];
$_temp = str_replace('{username}',$_SESSION['uname'],$str);
$_temp = str_replace('[bgpic]',getPic(),$_temp);
$_temp = str_replace('{url}',$_url,$_temp);
return $_temp;
}
我们来看看模板文件
}
#photo img{
border:none;
height:380px;
width:630px;
}
#infomation{
padding:5px 0 0 0;
position:absolute;
top:400px;
left:25px;
height:105px;
width:629px;
}
#entry{
margin:10px 0 0 6px;
float:left;
width:108px;
height:90px;
}
#entry ul{
margin: 0;
padding: 0;
}
#entry li{
float:left;
list-style:none;
text-indent:10px;
}
#entry a{
display:block;
height:42px;
width:53px;
}
#cjhd{
background:url(http://111cn.cn/emailimages/cjhd.gif) no-repeat top left;
height:42px;
width:53px;
}
#aygw{
background:url(http://111cn.cn/emailimages/aygw.gif) no-repeat top left;
height:42px;
width:53px;
}
#zdzx{
background:url(http://111cn.cn/emailimages/zdzx.gif) no-repeat top left;
height:42px;
width:53px;
}
#title{
height:21px;
margin:5px 0;
background:url(http://111cn.cn/emailimages/title.gif) no-repeat top left;
}
#artical{
margin:0 0 0 5px;
float:left;
width:180px;
height:105px;
overflow:hidden;
}
#words{
font-size:14px;
height:70px;
line-height:18px;
margin:20px 0 0 0;
}
#words p{
margin:0;
padding:0;
}
#words a{
text-decoration:underline;
color:#be2f60;
}
#artical{
margin:5px 0 0 0px;
}
#artical ul{
padding:0;
margin:5px 0 0 5px;
}
#artical ul li{
list-style:none;
background:url(111cn.cn/emailimages//emailimages/dot.gif) no-repeat 0px 7px;
text-indent:10px;
height:18px;
color:#505050;
float:left;
width:180px;
享有盛誉的PHP高级教程,Zend Framework核心开发人员力作,深入设计模式、PHP标准库和JSON 。 今天,PHP已经是无可争议的Web开发主流语言。PHP 5以后,它的面向对象特性也足以与Java和C#相抗衡。然而,讲述PHP高级特性的资料一直缺乏,大大影响了PHP语言的深入应用。 本书填补了这一空白。它专门针对有一定经验的PHP程序员,详细讲解了对他们最为重要的主题
455
立即学习“PHP免费学习笔记(深入)”;
}
#artical ul li a{
text-decoration:none;
color:#5e5e5e;
}
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号