📄 guestbook.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="ubb.asp"-->
<%
id=Request.QueryString("id")
If Request.QueryString("Page") = "" or Request.QueryString("Page") <= 0 then
Page = 1
Else
Page = CINT(Request.QueryString("Page"))
End If
user=Request.QueryString("user")
if user="" then
response.redirect "default.asp"
end if
set rs=server.createobject("adodb.recordset")
sql="select * from user where username='" & user &"'"
rs.Open SQL,conn,1,2
if rs.BOF or rs.EOF then
response.redirect "default.asp"
else
webname=rs("web")
web=rs("wwwhttp")
master=rs("webmaster")
kind=rs("kind")
if session("user")=rs("username") and session("pwd")=rs("password") then
adminok="ok"
end if
%>
<script language="javascript">
function popwin3(path)
{ window.open(path,"","height=450,width=600,resizable=yes,scrollbars=yes,status=no,toolbar=no,menubar=no,location=no");
}</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>::<%=webname%>::的留言板</title>
<link rel="stylesheet" type="text/css" href="style/<%=kind%>.css">
<script language="JavaScript">
<!--
function Juge(theForm)
{
if (theForm.name.value == "")
{
alert("请输入您的姓名!");
theForm.name.focus();
return (false);
}
if (checktext(theForm.name.value))
{
alert("请您输入有效姓名!");
theForm.name.select();
theForm.name.focus();
return (false);
}
if (theForm.email.value == "")
{
alert("请您输入\"email\"!");
theForm.email.focus();
return (false);
}
if (theForm.ly.value == "")
{
alert("请您输入内容!");
theForm.ly.focus();
return (false);
}
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_@.";
var checkStr = theForm.email.value;
var allValid = true;
for (i = 0; i < checkStr.length; i++)
{
ch = checkStr.charAt(i);
for (j = 0; j < checkOK.length; j++)
if (ch == checkOK.charAt(j))
break;
if (j == checkOK.length)
{
allValid = false;
break;
}
}
if (theForm.email.value.length < 6)
{
allValid = false;
}
if (!allValid)
{
alert("您输入的 \"电子邮件地址\" 无效!");
theForm.email.focus();
return (false);
}
address=theForm.email.value;
if(address.length>0)
{
i=address.indexOf("@");
if(i==-1)
{
window.alert("对不起!您输入的电子邮件地址是错误的!")
theForm.email.focus();
return false
}
ii=address.indexOf(".")
if(ii==-1)
{
window.alert("对不起!您输入的电子邮件地址是错误的!")
theForm.email.focus();
return false
}
}
if (checktext(theForm.email.value))
{
alert("请您输入有效的\"email\"!");
theForm.email.select();
theForm.email.focus();
return (false);
}
}
function checktext(text)
{
allValid = true;
for (i = 0; i < text.length; i++)
{
if (text.charAt(i) != " ")
{
allValid = false;
break;
}
}
return allValid;
}
//-->
</script>
</head>
<body>
<!--#include file="bof.asp"-->
<br>
<div align="center">
<form method="post" action="savebook.asp" onSubmit="return Juge(this)">
<table width="650" cellpadding="3" cellspacing="1" border="0" bgcolor="#000000" >
<tr>
<td width="300" height="170" valign="top" class="table001">
<table cellpadding="2" width="95%" cellspacing="2" border="0" >
<tr>
<td width="9%"><img src="images/nc.gif" width="24" height="24"></td>
<td width="14%" class="jnfont3">姓名</td>
<td width="77%">
<input type="text" name="name" maxlength="20" size="20" class="input1" >
<input name="user" value="<%=user%>" type="hidden">
</td>
</tr>
<tr>
<td width="9%"><img border=0 src=images/email.gif width="16" height="16"></td>
<td width="14%" class="jnfont3">Email</td>
<td width="77%">
<input type="text" name="email" maxlength="100" size="20" class="input1" >
</td>
</tr>
<tr>
<td width="9%"><img src="images/from.gif" width="16" height="16"></td>
<td width="14%" class="jnfont3">来自</td>
<td width="77%">
<select name="area" size="1">
<option selected value="北京">北京
<option value="广东">广东
<option value="上海">上海
<option value="新疆">新疆
<option value="辽宁">辽宁
<option value="广西">广西
<option value="海南">海南
<option value="湖南">湖南
<option value="甘肃">甘肃
<option value="河北">河北
<option value="湖北">湖北
<option value="江西">江西
<option value="江苏">江苏
<option value="西藏">西藏
<option value="山东">山东
<option value="浙江">浙江
<option value="安徽">安徽
<option value="福建">福建
<option value="吉林">吉林
<option value="黑龙江">黑龙江
<option value="山西">山西
<option value="云南">云南
<option value="贵州">贵州
<option value="四川">四川
<option value="陕西">陕西
<option value="重庆">重庆
<option value="天津">天津
<option value="河南">河南
<option value="青海">青海
<option value="宁夏">宁夏
<option value="台湾">台湾
<option value="香港">香港
<option value="澳门">澳门
<option value="其它地区">其它地区
</select>
</td>
</tr>
<tr>
<td width="9%"><img border=0 src=images/homepage.gif width="16" height="16"></td>
<td width="14%" class="jnfont3">主页</td>
<td width="77%">
<input type="text" name="http" maxlength="100" size="30" class="input1" >
</td>
</tr>
<tr>
<td width="9%"><img border=0 src=images/oicq.gif width="16" height="16" ></td>
<td width="14%" class="jnfont3">oicq</td>
<td width="77%">
<input type="text" name="oicq" maxlength="20" size="20" class="input1" >
</td>
</tr>
<tr>
<td width="9%"><img border=0 src=images/icq.gif width="18" height="18" ></td>
<td width="14%" class="jnfont3">icq</td>
<td width="77%">
<input type="text" name="icq" maxlength="20" size="20" class="input1" >
</td>
</tr>
<tr>
<td colspan="2" class="jnfont3">您的尊容:</td>
<td width="77%" class="jnfont5">
<select name="face" size=1>
<%dim i
for i=1 to 22%>
<option select value="images/<%=I%>.gif">头像<%=I%>
<%
next%>
</select>
<a href="javascript:popwin3('tou.htm')">查看头像列表</a> </td>
</tr>
</table>
</td>
<td width="300" height="170" valign="top" class="table001" >
<table width="292" cellpadding="2" cellspacing="2" border="0" align="center">
<tr>
<td width="10"><img src='images/post.gif' width="24" height="24"></td>
<td width="119" class="jnfont3">内容</td>
<td width="119" class="jnfont5">
<div align="center"><a href="javascript:popwin3('pubb.htm')">UBB代码用法</a></div>
</td>
</tr>
<tr>
<td colspan="3">
<textarea type="text" name="ly" rows="5" cols="44" class="testarea1"></textarea>
</td>
</tr>
<tr>
<td colspan="3" class="jnfont3">1)留言者不能发布任何不符合当地法规、国家法律和国际法律的资料;
</td>
</tr>
<tr>
<td colspan="3" class="jnfont3">2)留言者不得发布任何非法的、骚扰性的、中伤他人的、辱骂性的、恐吓性的、伤害性的、庸俗的,淫秽等信息资料;
</td>
</tr>
</table>
</td>
</tr>
<tr class="table003">
<td colspan="2" >
<div align="center">
<input type="submit" name="Submit" value="提交" class="input2">
<input type="reset" name="Submit2" value="重填" class="input2">
</div>
</td>
</tr>
</table>
</form>
<%
set rs1=server.createobject("adodb.recordset")
sql="select * from book where user='" & user &"' order by addtime desc"
rs1.Open SQL,conn,1,2
if not (rs1.EOF or rs1.BOF) then
rs1.PageSize=10
Dim TotalPages
TotalPages = RS1.PageCount
if page>rs1.pagecount then page=rs1.pagecount
dim scount
scount=INT(Rs1.recordcount)
rs1.absolutepage=page
StartPageNum=1
do while StartPageNum+10<=Page
StartPageNum=StartPageNum+10
Loop
EndPageNum=StartPageNum+9
If EndPageNum>RS1.Pagecount then EndPageNum=RS1.Pagecount
i=0
do while (not rs1.EOF) and (i<RS1.PageSize)
%>
<table width="650" cellspacing="1" cellpadding="3" bgcolor="#000000">
<tr bgcolor="#ffffff">
<td width="120px" rowspan="2" valign="top" class="table001">
<center>
<table class="jnfont7" ><font color=#ffffff><%=rs1("name")%></font>
</table>
<img border="0" src="<%=rs1("face")%>">
<br>
来自-<%=rs1("area")%>
</center>
</td>
<td width="530px" valign=top class="table002" height="105" style="word-break:break-all">
<table cellpadding=0 cellspacing=0 width=100% >
<tr>
<td width="26"><img src='images/post.gif' width="24" height="24"></td>
<td width="483">留言内容:
<%if rs1("email")<>"" then%>
<a href=mailto:<%=rs1("email")%> title="给<%=rs1("name")%>发信"><img border=0 src=images/email.gif width="16" height="16">信箱</a>
<%end if%>
<%if rs1("http")<>"" then%>
<a href=<%=rs1("http")%> target=_blank title="访问<%=rs1("name")%>的主页"><img border=0 src=images/homepage.gif width="16" height="16">主页</a>
<%end if%>
<%if rs1("oicq")<>"" then%>
<a href="http://search.tencent.com/cgi-bin/friend/user_show_info?ln=<%=rs1("oicq")%>" target="_blank" ><img src=images/oicq.gif width="16" height="16" alt="<%=rs1("name")%>的QQ号码:<%=rs1("oicq")%>" border="0"><%=rs1("oicq")%></a>
<%end if%><%if rs1("icq")<>"" then%><img src="http://online.mirabilis.com/scripts/online.dll?icq=<%=rs1("icq")%>&img=5" width="18" height="18" alt="<%=rs1("icq")%>"><%end if%><img src=images/ip.gif alt="<%=rs1("ip")%>" width="13" height="15"><%=rs1("ip")%></td>
</tr>
</table>
<hr size="1">
<%=ubb(changechr(rs1("ly")))%></td>
</tr>
<tr class="table001">
<td height="13">
<div align="right">发表于:<%=rs1("addtime")%> <%if rs1("rely")<>"" then%>回复于:<%=rs1("retime")%> <%end if%>
<%if adminok="ok" then%><a href=manage.asp?id=<%=rs1("id")%>><img src=images/re.gif border=0 height=16 width=16 alt="回复或修改回复">回复</a>
<a href=manage.asp?id=<%=rs1("id")%>&kind=del><img src=images/del.gif border=0 height=16 width=16 alt="删除">删除</a><%end if%></div>
</td>
</tr>
<%if rs1("rely")<>"" then%>
<tr class="table002">
<td width="120px" valign="top" ><div align="center">版主回复<br><img border="0" src="images/repost.gif"><br>
<table class="jnfont5" ><%=master%></table></div></td>
<td width="530px"><table class="jnfont5" ><%=ubb(changechr(rs1("rely")))%></table></td>
</tr>
<%end if%>
</table><BR>
<%i=i+1
rs1.MoveNext
loop
%>
<table width="650" cellspacing="1" cellpadding="3" bgcolor="#000000" class="jnfont5">
<tr class="table003">
<form method="GET" action="sou.asp">
<td align=center width="40%">
<div align="center">关键字:
<input type="text" name="sou" size=15 class="input2">
<input type="hidden" name="id" value=<%=user%>>
<input name="B1" type="submit" value="搜索" class="input2">
</div>
</td></form>
<td valign="middle" >
<div align="center">
<table>
共<b><%=scount%></b>条 [
<% if StartPageNum>1 then %>
<a href="guestbook.asp?user=<%=user%>&Page=<%=StartPageNum-1%>"><<</a>
<%end if%>
<% For I=StartPageNum to EndPageNum
if I<>Page then %>
<a href="guestbook.asp?user=<%=user%>&Page=<%=I%>"><%=I%></a>
<% else %>
<b><%=I%></b>
<% end if %>
<% Next %>
<% if EndPageNum<RS1.Pagecount then %>
<a href="guestbook.asp?user=<%=user%>&Page=<%=EndPageNum+1%>">>></a>
<%end if%>
]
</table>
</div>
</td>
</tr>
</table>
<p align="left"><%else%> </p>
<table align=center ><td class="jnfont3">对不起,还没有记录</td></table>
<%end if%>
</div>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -