<?php
require("config/config.php");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="config/css.css" rel="stylesheet" type="text/css">
<title>guestbook</title>
<style type="text/css">
<!--
#Layer1 {
position:absolute;
width:78px;
height:27px;
z-index:1;
left: 1064px;
top: 29px;
visibility: visible;
}
#Layer2 {
position:absolute;
width:77px;
height:20px;
z-index:2;
left: 1065px;
top: 54px;
}
#Layer3 {
position:absolute;
width:79px;
height:22px;
z-index:1;
left: 1063px;
top: 78px;
}
.style_1{
margin-top:5px;margin-left:5px;margin-right:5px;margin-bottom:5px;
PADDING-LEFT: 5px; PADDING-RIGHT: 5px; /**/PADDING-TOP: 5px; PADDING-BOTTOM: 5px;
BORDER-RIGHT: #cccccc 1px solid; BORDER-LEFT: #cccccc 1px solid; BORDER-TOP: #cccccc 1px solid; BORDER-BOTTOM: #cccccc 2px solid;
width:950px;
}
table,td,tr,th,div{font-size:12px;}
-->
</style>
</head>
<body>
<div class="first">
<div class="head"><img src="img/logo.gif" width="960" height="110" />
<div id="Layer1"><a href="#" class="head" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('guest.php');">设为主页</a></div>
<div id="Layer2"><a href="javascript:window.external.AddFavorite('guestbook.php','留言板')" class="head">加入收藏</a></div>
<div id="Layer3"><a href="mailto:691504619@qq.com" class="head">联系站长</a></div>
</div>
<div class="daohang" align="left" style="width:960px;">
<table width="960" height="36" border="1" cellspacing="0" bordercolor="#999999">
<tr><td valign="middle">
<?php $sql="select * from daohang order by sxshuanxu desc,id";
$rs = $conn->Execute($sql);
while (!$rs->EOF):?> <a href="<?php echo $rs['link']; ?>" target="<?php echo $rs['mubiao']; ?>"><?php echo $rs['title']?></a>
<?php $rs->MoveNext();endwhile;
$rs->Close();
?></td>
</tr></table>
</div>
<?php
/*打开数据库*/
$scriptname = split('[/]',$_SERVER['SCRIPT_NAME']);
$filename = end($scriptname);
$connstr="DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=". realpath("C:\AppServ\www\guest\guestbook.mdb") ." ;DefaultDir=". realpath(".");
$Conn=new COM("ADODB.Connection");
$RS =new COM("ADODB.RecordSet");
$Conn->open($connstr);
/*打开数据库*/
/*查询数据库*/
$article="select * from liuyan order by settop desc,id desc";
$RS->open($article,$Conn,1,1);//执行语句,返回记录集
$pagesize=$RS->Pagesize=5;//设置每页显示条数
if($RS->PageCount<>0){//防止数据库为空
if(!empty($_GET['page'])){
if($_GET['page']<=0){
$RS->AbsolutePage=1;
$nowpage=1;
}elseif($_GET['page']>$RS->PageCount){
$RS->AbsolutePage=$RS->PageCount;
$nowpage=$RS->PageCount;
}else{
$RS->AbsolutePage=$_GET['page'];
$nowpage=$_GET['page'];
}
}else{
$RS->AbsolutePage=1;
$nowpage=1;
}
}else{
$nowpage = 1;
$pagesize = 0;
}
/*查询数据库*/
?>
<div class="body">
<?php
for ($m=1; $m<=$pagesize; $m++)//按照每页显示条数的设定进行循环
{
if (!$RS->EOF){//防止达到记录集尾产生错误
?>
<table width="960" border="1" cellspacing="0" bordercolor="#999999" class="tb">
<tr><td width="20%" rowspan="3"><div align="center"><img src="admin/<?php echo $RS['face'] ?>" /></div><br />
<div align="center">昵称:【<?php echo $RS['usename']; ?>】</div></td>
<td width="80%" height="30" valign="middle"><div align="left">发表于:<?php echo $RS['time']; ?>
<?php if($RS["settop"]==1) echo "已置顶";?>
</div></td>
</tr>
<tr>
<td width="80%" height="115">
<table width="100%" height="100%">
<tr><td>
<div align="left">
<?php
if($RS['checked']==0){
echo '(此留言已被隐藏或需要审核才能显示!)';
}else{
echo $RS['content'];
}
?>
</div></td></tr>
<?php if($RS['replycontent']->Value!=""){?>
<tr><td><div align="center">
<table width="60%" class="reply">
<tr>
<td><div align="left">管理员回复:<br />
<?php echo $RS['replycontent']; ?>
</div>
<div align="right">回复人:<?php echo $RS['replyer'] ?> 时间:<? echo $RS['replytime'] ?></div></td></tr>
</table>
</div></td>
</tr>
<?php } ?>
</table></td></tr>
<tr><td width="80%" height="30" align="right" valign="middle"><?php if($RS['postQQ']->Value!=""){?><img src="admin/face/qq.gif" /> <?php echo $RS['postQQ']; }?> <?php if($RS['postemail']->Value!=""){?><img src="admin/face/mail.gif" /> <? echo $RS['postemail']; }?> </td></tr>
</table>
<?php
$RS->MoveNext();
}
}
if($RS->PageCount==0){//防止数据库为空
echo "没有数据";
}
?>
</div>
</div>
<div class="style_1">
<?
/*显示数据库*/
echo "当前显示第".$nowpage."页 ";
echo "每页".$pagesize.'条 ';
echo "共有".$RS->RecordCount."条记录 ";
echo "共有".$RS->PageCount."页 ";
?>
</div>
<div class="style_1">
<?
//防止数据库为空
if($RS->PageCount<>0){
echo "<a href=?page=1>首页</a>";
if (!($nowpage<=1)){
echo " <a href=?page=".($nowpage-1).">上一页</a> ";
}else{
echo " 上一页 ";
}
if (!($nowpage>=$RS->PageCount)){
echo " <a href=?page=".($nowpage+1).">下一页</a> ";
}
else{
echo " 下一页 ";
}
echo "<a href=?page=".$RS->PageCount.">尾页</a>";
}
?>
</div>
<div>
<?php
$fsql="select * from footer";
$frs=$conn->Execute($fsql);
while(!$frs->EOF):
echo $frs['conter'];
$frs->MoveNext();endwhile;$frs->Close(); ?></div>
</div>
</body>
</html>
php+access留言板
4星 · 超过85%的资源 需积分: 9 163 浏览量
2008-12-02
16:43:32
上传
评论
收藏 328KB RAR 举报
lichao032100
- 粉丝: 2
- 资源: 9
最新资源
- java +elasticsearch+倒排索引技术+PUT+GET+全文搜索、短语匹配、近似搜索和聚合等操作高效执行
- ES数据迁移~~~~~~~~~~~~~~
- E3P303-VB一款SOP8封装2个P-Channel场效应MOS管
- SpyGlass-LowPowerRules-Reference
- 基于Java的SSM框架矿建环境搭建设计源码
- SpyGlass-PowerVerifyAdvancedRules-Reference
- java作业管理系统设计(源代码+论文).rar
- 奥迪C6仪表开机报文··
- SpyGlass-PowerEstimate-And-SpyGlass-PowerReduceRules-Reference
- E3P102-VB一款SOP8封装2个P-Channel场效应MOS管
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页