📄 index.asp
字号:
<!--#include file="conn.asp"-->
<%
var rs=Server.CreateObject("ADODB.Recordset");
var sql="select * from main order by time desc";
rs.Open(sql,conn,3,3);
if(!rs.EOF)
{
var numperpage=10;
var count=0;
rs.MoveFirst();
while(!rs.EOF && !rs.BOF)
{
++count;
rs.MoveNext();
}
rs.MoveFirst();
var pagenum=0;
if(count%numperpage==0)
pagenum=count/numperpage;
else
pagenum=parseInt(count/numperpage,10)+1;
var pageno=1;
pageno=String(Request("pageno"));
if(pageno=="undefined")
pageno=1;
else
{
if(pageno>pagenum)
pageno=pagenum;
else
{
var pageno=parseInt(Request("pageno"),10);
for(i=0;i<(pageno-1)*numperpage;i++)
rs.MoveNext();
}
}
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<STYLE>
BODY {BODY
SCROLLBAR-FACE-COLOR:
rgb(204,255,102);
SCROLLBAR-3DLIGHT-COLOR:
rgb(204,255,102);
SCROLLBAR-DARKSHADOW-COLOR:
rgb(204,255,102);
SCROLLBAR-BASE-COLOR:
rgb(204,255,102);}
</STYLE>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>留言本</title>
<style type="text/css">
<!--
@import url("css.css");
.unnamed1 {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FF6600;
}
a:link,a:visited {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #3399CC;
text-decoration: none;
}
a:hover {
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FF6600;
text-decoration: blink;
}
body {
background-color: #666666;
margin-top: 0px;
margin-left: 0px;
margin-right: 0px;
background-image: url(img/bg3.gif);
}
.style1 {color: #000000}
.style2 {
color: #666666;
font-size: 16;
}
.style3 {
color: #CCFF66;
font-size: 14px;
}
.style4 {color: #3399CC}
.style5 {color: #333333}
-->
</style>
</head>
<body class="unnamed1">
<table width="80%" height="90" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="39" background="img/bg4.gif"> </td>
<td width="265" background="img/bg4.gif"><table width="265" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="265" height="90" background="img/top.gif"><img src="img/logo.gif" width="265" height="90"></td>
</tr>
</table></td>
<td width="490" background="img/bg4.gif"><table width="490" height="90" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="60" colspan="7" background="img/hole.gif"><table width="490" height="60" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="52" height="30"> </td>
<td width="146" height="30" valign="bottom"><a href="new.asp">我要留言</a></td>
<td width="31" height="30" valign="bottom"> </td>
<td width="152" height="30" valign="bottom"><a href="admin.asp">信息管理 </a></td>
<td width="30" height="30" valign="bottom"> </td>
<td width="79" height="30" valign="bottom"><a href="admin.asp"> </a><a href="index.asp">首页</a></td>
</tr>
<tr>
<td colspan="6"><table width="100%" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="20%"> </td>
<td width="7%"> </td>
<td width="31%"><a href="logout.asp" class="style5">
<%if (Session("login")==true){%>
</a><a href="edit.asp">修改资料 </a>
<%}%></td>
<td width="8%"> </td>
<td width="34%"><a href="search.htm"> </a><a href="logout.asp" class="style5">
<%if (Session("login")==true){%>
</a><a href="search.htm">搜索</a>
<%}%></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td width="136"> </td>
<td width="30"><img src="img/button.gif" width="30" height="30"></td>
<td width="70"><div align="center"><a href="login.asp">
<%if (Session("login")==false){%>
登陆 </a>
<%}%>
</div></td>
<td width="30"><img src="img/button.gif" width="30" height="30"></td>
<td width="70"><div align="center"><a href="reg1.asp">注册</a></div></td>
<td width="30"><img src="img/button.gif" width="30" height="30"></td>
<td width="124"><a href="logout.asp" class="style5">
<%if (Session("login")==true){%>
退出</a>
<%}%></td>
</tr>
</table></td>
</tr>
</table>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td background="img/bg4.gif"><div align="center"><img src="img/line.gif" width="722" height="3"></div></td>
</tr>
</table>
<table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="62%" height="30" background="img/bg4.gif"> </td>
<td width="4%" background="img/bg4.gif"><img src="img/button.gif" width="30" height="30"></td>
<td width="18%" background="img/bg4.gif"><div align="center"><span class="style4">当前在线</span><span class="style3"><%=Application("online")%></span><span class="style4">人</span></div></td>
<td width="4%" background="img/bg4.gif"><img src="img/button.gif" width="30" height="30"></td>
<td width="12%" background="img/bg4.gif"> </td>
</tr>
</table>
<%while(!rs.EOF && numperpage>0) {
var us=Server.CreateObject("ADODB.Recordset");
var usql="select * from user where username='"+rs("from")+"'";
us.Open(usql,conn);
%>
<table width="60%" height="161" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" class="thin">
<tr>
<td width="15%" height="22" bgcolor="#333333"><img src="img/home.gif" width="16" height="21">访客信息 </td>
<td width="85%" bgcolor="#333333"><img src="img/ao.gif" width="16" height="18" title="<%=rs("title")%>">留言主题:<%=rs("title")%> <img src="img/oicq.gif" width="45" height="18" title="<%=us("QQ")%>">:<%=us("QQ")%> <img src="img/mail.gif" width="16" height="16" title="<%=us("email")%>">邮箱:<%=us("email")%> <a href="<%=us("home")%>"><img src="img/homepage.gif" width="47" height="18" border="0" title="访问<%=us("nickname")%>的主页?"><%=us("home")%></a></a></td>
</tr>
<tr>
<td bgcolor="#666666"><table width="139" height="135" border="0" cellpadding="0" cellspacing="0" bgcolor="#666666">
<tr>
<td height="21" valign="top" bgcolor="#666666">头像:</td>
</tr>
<tr>
<td height="70" align="center" valign="top"><img src="<%=us("face")%>" title="<%=us("username")%>"> </td>
</tr>
<tr>
<td height="20" bgcolor="#666666">★<%=us("nickname")%>★<img src="face/<%=us("sex")%>.gif" width="21" height="21"></td>
</tr>
</table></td>
<td colspan="2" background="img/cvan.jpg" bgcolor="#CCFF66"><table height="89" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="559" align="left"><p>留言:</p> </td>
</tr>
<tr>
<td><p><br>
<%=rs("content")%><img src="emot/<%=rs("emot")%>"></p> </td>
</tr>
<tr>
<td height="29" align="right"><p>「<%=us("username")%>」发表于:<%=rs("time")%><br>
--------------------------------------------------------------<br>
<%if(Session("login")==true){%>
<a href=reply.asp?id=<%=rs("id")%>>■回复本贴</a> <a href=del.asp?id=<%=rs("id")%>>■删除本贴</a>
<%}%>
</p> </td>
</tr>
</table></td>
</tr>
</table>
<%
var title=rs("id");
var rrs=Server.CreateObject("ADODB.Recordset");
var sql="select * from reply where title="+title+"";
rrs.Open(sql,conn,3,3);
while(!rrs.EOF)
{
%><table width="60%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#000000" class="thin">
<tr>
<td width="15%" rowspan="2" background="img/bgx3.gif" bgcolor="#333333" scope="row">回复</td>
<td height="50" bgcolor="#666666"><%=rrs("content")%> <img src="emot/<%=rrs("emot")%>"></td>
</tr>
<tr>
<td align="right">「<%=rrs("replyid")%>」回复于:<%=rrs("time")%><div align="right"></div></td>
</tr>
</table>
<%
rrs.MoveNext();
}rrs.Close();
%>
<%
us.Close();
numperpage--;
rs.MoveNext();
}
%>
<form name="form1" method="post" action="index.asp">
<table width="60%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="87%">
<div align="right">
<p>
<%if (pagenum>1) {%>
<a href="index.asp?pageno=1"><span class="font-brown">『第一页』</span></a> <font color="#996600"><span class="font-brown">
<%}%>
<%if (pageno>1) {%>
</span></font><span class="font-brown"><a href="index.asp?pageno=<%=(pageno-1)%>">『上一页』</a></span><font color="#996600"><span class="font-brown">
<%}%>
<%if (pageno<pagenum) {%>
</span></font><span class="font-brown"><a href="index.asp?pageno=<%=(pageno+1)%>">『下一页』</a></span><font color="#996600"><span class="font-brown">
<% }%>
<%if (pagenum>1) {%>
</span></font><span class="font-brown"><a href="index.asp?pageno=<%=pagenum%>">『尾页』</a></span><font color="#996600"><span class="font-brown">
<%}%>
</span></font><span class="font-brown">当前位置:</span><span class="style1"><%=pageno%>/<%=pagenum%></span><span class="font-brown">跳转到第
<input type="text" name="pageno" size="4" class="input1">
页
<input name="Submit" type="submit" class="unnamed1" value="go">
</span> </p>
</div></td>
</tr>
</table>
</form>
<div align="center">
<table width="80%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center"><img src="img/line.gif" width="650" height="3"></div></td>
</tr>
</table>
<br>
<br>
Powered By:Kunta. Wang<br>
All Rights Rerserves©</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -