本文实例为大家分享了PHP留言本功能的具体代码,供大家参考,具体内容如下
index.php
$pageCount) //如果输入的页数超过总页数则默认跳转到最后一页
{
$currpage=$pageCount;
}
?>
条留言
- 留言标题
- 用户网名
- 时间
留言内容:
-
«";
}
}
?>
$i";
}else{
echo "
- $i ";} } ?> »"; } } ?>
发表留言
conn.php
result.php
",str_replace(" "," ",$content)); //显示'空格'和'回车'
$week = '星期'.mb_substr( "日一二三四五六",date("w"),1,"utf-8" );
$isok =mysql_query("insert into guestlist(title,username,content,addtime)values('$title','$username','$content','".date("Y-m-d H:i:s")." $week ')");
if($isok)
{
echo "";
}else {
echo "";
}
?>
css/index.css
body{margin:0;padding:0;}
ul,li{list-style: none;margin:0;padding:0;}
a{text-decoration: none;}
.content{
width:800px;
margin:0 auto;
}
.bt{
width:799px;
height:20px;
text-align: center;
background:#EB9316;
margin:0 0 5px 0;
}
.bt>li{
float:left;
width:265px;
height:20px;
text-align: center;
line-height: 20px;
font-size:13px;
}
.nr{
float:left;
width:799px;
height:20px;
text-align: center;
background:#B9DEF0;
}
.nr>li{
float:left;
width:265px;
height:20px;
text-align: center;
line-height: 20px;
font-size:13px;
}
.lynr{
float:left;
width:800px;
margin:1px 0 1px 0;
}
.content p{
width:70px;
height:50px;
float:left;
}
.content span{
display: block;
width:710px;
float:left;
}
td{
width:80px;
padding:5px 0;
}
td input,textarea{
border: 1px solid #79ABFE;
}
dist/css/bootstrap.min.css(自己下载)
效果图:
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持考高分网。



