📄 guestbook.asp
字号:
<%OPTION EXPLICIT%>
<!--#include file="Include/Config.asp"-->
<!--#include file="Include/SQLUser.asp"-->
<!--#include file="Include/Conn.asp"-->
<!--#include file="Include/IPLockUser.asp"-->
<!--#include file="Include/Style.asp"-->
<html>
<head>
<title>用户留言__<%=WebSiteName%></title>
<meta http-equiv="Content-Type" content="text/html;charset=gb2312">
<meta http-equiv="Content-Language" Content="zh-CN">
<meta name="Keywords" Content="<%=WebSiteMKeywords%>">
<meta name="Description" Content="<%=WebSiteMDescription%>">
<link type="text/css" rel="stylesheet" href="Include/Style.css">
<link type="text/css" rel="stylesheet" href="Style/<%=WebSiteStyle%>/Style.css">
<Script Language="JavaScript" src="Include/Function.js"></Script>
<Script Language="JavaScript" src="Include/PopText.js"></Script>
</head>
<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<!--#include file="Include/Top.asp"-->
<!--#include file="Include/Menu.asp"-->
<!--#include file="Include/Ads2.asp"-->
<center>
<table border="0" cellpadding="0" cellspacing="1" width="780" height="10" class="T_BGColor_1">
<tr>
<td width="205" class="T_TD_BGColor_1_1" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="100%" height="10">
<tr>
<td height="8"></td>
</tr>
<%if GuestbookSearchShow="1" then%>
<tr>
<td height="40" background="Style/<%=WebSiteStyle%>/TD_T_Bg_L.gif"><table border="0" cellpadding="0" cellspacing="0" width="188" height="26"><tr><td width="45" align="right"><img src="Style/<%=WebSiteStyle%>/TD_T_Search.gif" width="26" height="26" border="0"></td><td width="140" valign="bottom"><font class="WSText"><%=GuestbookSearchTitle%></font></td></tr></table></td>
</tr>
<tr>
<td height="10" align="center" valign="top"><!--#include file="Include/Search.asp"--></td>
</tr>
<%end if%>
<tr>
<td height="1" align="center" valign="top"><!--#include file="Include/Ads7.asp"--></td>
</tr>
<%if GuestbookHitsShow="1" then%>
<tr>
<td height="40" background="Style/<%=WebSiteStyle%>/TD_T_Bg_L.gif"><table border="0" cellpadding="0" cellspacing="0" width="188" height="26"><tr><td width="45" align="right"><img src="Style/<%=WebSiteStyle%>/TD_T_Hits.gif" width="26" height="26" border="0"></td><td width="140" valign="bottom"><font class="WSText"><%=GuestbookHitsTitle%></font></td></tr></table></td>
</tr>
<tr>
<td height="10"><%
dim rsWeekHits
set rsWeekHits=Server.CreateObject("Adodb.RecordSet")
GuSQL="select top "&GuestbookHitsNum&" Ar_ID,Ar_Name,Ar_NameColor,Ar_Show,Ar_DateTime,Ar_WeekHits from "&GuTablePrefix&"_Article where Ar_Show='1' and Ar_UserPublish='0' order by Ar_WeekHits desc,Ar_ID desc"
rsWeekHits.open GuSQL,GuConn,1,1
if rsWeekHits.eof and rsWeekHits.bof then
Response.write "<br> <font class=""SilverS12"">没有找到相关数据</font><br><br>"
else
do while not rsWeekHits.eof
Response.write " <img src=""Style/"&WebSiteStyle&"/Title_02.gif"" border=""0""><a href=""Article.asp?ID="&rsWeekHits("Ar_ID")&""" style=""color:"&rsWeekHits("Ar_NameColor")&""" class=""BlackV12"" title="""&rsWeekHits("Ar_Name")&" "&rsWeekHits("Ar_DateTime")&""">"&GuStringCut(rsWeekHits("Ar_Name"),24)&"</a><br>"
rsWeekHits.movenext
loop
end if
rsWeekHits.close
set rsWeekHits=Nothing
%></td>
</tr>
<%end if%>
<tr>
<td height="1"></td>
</tr>
</table></td>
<td width="572" class="T_TD_BGColor_1_2" align="center" valign="top"><table border="0" cellpadding="0" cellspacing="0" width="98%" height="10">
<tr>
<td height="8"></td>
</tr>
<tr>
<td height="40" background="Style/<%=WebSiteStyle%>/TD_T_Bg_R.gif"><table border="0" cellpadding="0" cellspacing="0" width="288" height="26"><tr><td width="45" align="center"><img src="Style/<%=WebSiteStyle%>/TD_T_Guestbook.gif" border="0" width="26" height="26"></td><td width="240" valign="bottom"><font class="WSText">用 户 留 言 中 心</font></td></tr></table></td>
</tr>
<tr>
<td height="6"></td>
</tr>
<tr>
<td height="10" align="center" valign="top">
<%
if GuestbookAllow="1" and Trim(Request.Form("GuComm"))="Guestbook" then
dim GB_Content
if GuestbookValidationCode="1" and UCase(Trim(Request.Form("GuValidationCodeInput")))<>Request.Cookies("GuValidationCodeCookies") then
Response.write "<center><table border=""0"" cellpadding=""0"" cellspacing=""1"" width=""558"" height=""80"" class=""T_BGColor_2""><tr><td class=""T_TD_BGColor_2_2"" align=""""> <img src=""Style/"&WebSiteStyle&"/Title_07.gif"" width=""60"" height=""60"" border=""0"" align=""absmiddle""> <font class=""RedS12"">留言失败,验证码输入错误</font></td></tr></table></center>"
elseif Len(Trim(Request.Form("GB_Content")))>GuestbookContentKB then
Response.write "<center><table border=""0"" cellpadding=""0"" cellspacing=""1"" width=""558"" height=""80"" class=""T_BGColor_2""><tr><td class=""T_TD_BGColor_2_2"" align=""""> <img src=""Style/"&WebSiteStyle&"/Title_07.gif"" width=""60"" height=""60"" border=""0"" align=""absmiddle""> <font class=""RedS12"">留言失败,留言内容字数超过了限制</font></td></tr></table></center>"
else
GB_Content=Request.Form("GB_Content")
GB_Content=Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(GB_Content,"'","’"),"<","<"),">",">"),"&","&"),"?","?"),"delete","删除"),"update","更新"),"insert","插入"),"select","选择")
dim rsGB1
set rsGB1=Server.CreateObject("Adodb.RecordSet")
GuSQL="select * from "&GuTablePrefix&"_GuestBook where (GB_ID is null)"
rsGB1.open GuSQL,GuConn,1,3
rsGB1.addnew
rsGB1("GB_Type")=Trim(Request.Form("GB_Type"))
rsGB1("GB_UserName")=Trim(Request.Form("GB_UserName"))
rsGB1("GB_UserQQ")=Trim(Request.Form("GB_UserQQ"))
rsGB1("GB_UserEmail")=Trim(Request.Form("GB_UserEmail"))
rsGB1("GB_Content")=GB_Content
rsGB1("GB_GuResourceID")=Trim(Request.Form("GuResourceID"))
rsGB1("GB_GuResourceName")=Trim(Request.Form("GuResourceName"))
rsGB1("GB_GuResourceNameColor")=Trim(Request.Form("GuResourceNameColor"))
rsGB1("GB_SortID")=Trim(Request.Form("SortID"))
rsGB1("GB_AsSortID")=Trim(Request.Form("AsSortID"))
rsGB1("GB_UserIP")=GuUserIP
rsGB1("GB_DateTime")=Now()
rsGB1.update
rsGB1.close
set rsGB1=Nothing
Response.write "<center><table border=""0"" cellpadding=""0"" cellspacing=""1"" width=""558"" height=""80"" class=""T_BGColor_2""><tr><td class=""T_TD_BGColor_2_2"" align=""""> <img src=""Style/"&WebSiteStyle&"/Title_09.gif"" width=""60"" height=""60"" border=""0"" align=""absmiddle""> <font class=""BlueS12"">留言已提交成功,感谢你的留言</font></td></tr></table></center>"
end if
Response.write "<center><table border=""0"" width=""558"" height=""6""><tr><td></td></tr></table></center>"
end if
if GuestbookAllow="1" then
if Trim(Request.QueryString("ID"))<>"" then
dim rsGB2,SortID,AsSortID,GuResourceID,GuResourceName,GuResourceNameColor
set rsGB2=Server.CreateObject("Adodb.RecordSet")
GuSQL="select Ar_SortID,Ar_AsSortID,Ar_Name,Ar_NameColor from "&GuTablePrefix&"_Article where Ar_UserPublish='0' and Ar_ID="&Trim(Request.QueryString("ID"))
rsGB2.open GuSQL,GuConn,1,1
if rsGB2.eof and rsGB2.bof then
Response.write "<center><table border=""0"" cellpadding=""0"" cellspacing=""1"" width=""558"" height=""80"" class=""T_BGColor_2""><tr><td class=""T_TD_BGColor_2_2"" align=""center""><img src=""Style/"&WebSiteStyle&"/Title_07.gif"" width=""60"" height=""60"" border=""0"" align=""absmiddle""> <font class=""MaroonS12"">数据获取失败,没有找到相关数据</font></td></tr></table></center><br><br>"
else
SortID=rsGB2("Ar_SortID")
AsSortID=rsGB2("Ar_AsSortID")
GuResourceID=Request.QueryString("ID")
GuResourceName=rsGB2("Ar_Name")
GuResourceNameColor=rsGB2("Ar_NameColor")
rsGB2.close
set rsGB2=Nothing
%>
<table border="0" cellpadding="0" cellspacing="1" width="558" height="10" class="T_BGColor_2">
<form name="Guestbook" method="post" action="Guestbook.asp?ID=<%=GuResourceID%>" onsubmit="JavaScript:Guestbook.GB_Content.select();document.execCommand('Copy');">
<tr>
<td width="80" height="28" class="T_TD_BGColor_2_1" align="center"><font class="BlackS12">文章标题</font></td>
<td width="475" height="28" class="T_TD_BGColor_2_1" colspan="2"> <a href="Article.asp?ID=<%=GuResourceID%>" style="color:<%=GuResourceNameColor%>" class="BlackV12"><%=GuResourceName%></a></td>
</tr>
<tr>
<td width="80" height="28" class="T_TD_BGColor_2_2" align="center"><font class="BlackS12">留言类型</font></td>
<td width="475" height="28" class="T_TD_BGColor_2_2" colspan="2"> <font class="BlackS12"><input type="radio" name="GB_Type" value="GB_Error" id="LabelGB_Error" checked><label for="LabelGB_Error">文章内容有错</label> <input type="radio" name="GB_Type" value="GB_Idea" id="LabelGB_Idea"><label for="LabelGB_Idea">意见建议</label> <input type="radio" name="GB_Type" value="GB_Admin" id="LabelGB_Admin"><label for="LabelGB_Admin">联系管理员</label></font></td>
</tr>
<tr>
<td width="80" height="28" class="T_TD_BGColor_2_2" align="center"><font class="BlackS12">用户昵称</font></td>
<td width="270" height="28" class="T_TD_BGColor_2_2"> <input type="text" name="GB_Username" style="width:252;" class="CSS_InputText" maxlength="20"></td>
<td width="204" height="28" class="T_TD_BGColor_2_2"></td>
</tr>
<tr>
<td width="80" height="28" class="T_TD_BGColor_2_2" align="center"><font class="BlackS12">用户QQ</font></td>
<td width="270" height="28" class="T_TD_BGColor_2_2"> <input type="text" name="GB_UserQQ" onKeypress="if(event.keyCode<48||event.keyCode>57)event.returnValue=false;" style="width:252;" class="CSS_InputText" maxlength="10"></td>
<td width="204" height="28" class="T_TD_BGColor_2_2"></td>
</tr>
<tr>
<td width="80" height="28" class="T_TD_BGColor_2_2" align="center"><font class="BlackS12">用户邮箱</font></td>
<td width="270" height="28" class="T_TD_BGColor_2_2"> <input type="text" name="GB_UserEmail" style="width:252;" class="CSS_InputText" maxlength="50"></td>
<td width="204" height="28" class="T_TD_BGColor_2_2"> <font class="BlackS12">如果需要回复,请留下联系方式</font></td>
</tr>
<tr>
<td width="80" height="88" class="T_TD_BGColor_2_2" valign="top"><table border="0" width="100%" height="10" cellspacing="0" cellpadding="0"><tr><td height="26" align="center"><font class="BlackS12">留言内容</font></td></tr><tr><td height="1" class="T_BGColor_2"></td></tr></table></td>
<td width="270" height="88" class="T_TD_BGColor_2_2"> <textarea name="GB_Content" cols="1" rows="1" onKeyDown="GuTextareaLenCheck(document.Guestbook.GB_Content,document.Guestbook.GuTextareaLenInput,<%=GuestbookContentKB%>)" onKeyUp="GuTextareaLenCheck(document.Guestbook.GB_Content,document.Guestbook.GuTextareaLenInput,<%=GuestbookContentKB%>)" style="width:252;height:78;" class="CSS_TextArea"></textarea></td>
<td width="204" height="88" class="T_TD_BGColor_2_2" align="center"><table border="0" width="96%" height="10"><tr><td height="58"></td></tr><tr><td height="20"><input type="text" name="GuTextareaLenInput" value="<%=GuestbookContentKB%>" style="width:60;text-align:right;" class="CSS_InputText" readonly></td></tr></table></td>
</tr>
<%if GuestbookValidationCode="1" then%>
<tr>
<td width="80" height="28" class="T_TD_BGColor_2_2" align="center"><font class="BlackS12">验 证 码</font></td>
<td width="270" height="28" class="T_TD_BGColor_2_2"> <input type="text" name="GuValidationCodeInput" style="width:60;" class="CSS_InputText" maxlength="6"> <img src="Include/ValidationCode.asp" style="cursor:pointer;width:46;height:12" onclick="this.src='Include/ValidationCode.asp?'+Math.random()" title="刷新验证码"></td>
<td width="204" height="28" class="T_TD_BGColor_2_2"> <font class="BlackS12">填写验证码,单击验证码即刷新</font></td>
</tr>
<%end if%>
<tr>
<td width="80" height="38" class="T_TD_BGColor_2_2" align="center"><input type="hidden" name="GuComm" size="1" value="Guestbook"><input type="hidden" name="GuResourceID" size="1" value="<%=GuResourceID%>"><input type="hidden" name="GuResourceName" size="1" value="<%=GuResourceName%>"><input type="hidden" name="GuResourceNameColor" size="1" value="<%=GuResourceNameColor%>"><input type="hidden" name="SortID" size="1" value="<%=SortID%>"><input type="hidden" name="AsSortID" size="1" value="<%=AsSortID%>"></td>
<td width="475" height="38" class="T_TD_BGColor_2_2" colspan="2"> <input type="submit" name="Submit" value="" class="Button_OK"> <input type="reset" value="" name="reset" class="Button_Reset"></td>
</tr>
</form>
</table>
<br>
<%
if GuestbookNoteShow="1" then
dim rsGB8
set rsGB8=Server.CreateObject("Adodb.RecordSet")
GuSQL="select * from "&GuTablePrefix&"_Config where Co_ID=1"
rsGB8.open GuSQL,GuConn,1,1
if not(rsGB8.eof and rsGB8.bof) then
%>
<table border="0" cellpadding="0" cellspacing="1" width="558" height="10" class="T_BGColor_2">
<tr>
<td width="80" height="28" class="T_TD_BGColor_2_2" valign="top"><table border="0" width="100%" height="10" cellspacing="0" cellpadding="0"><tr><td height="26" align="center"><font class="BlackS12">留言说明</font></td></tr><tr><td height="1" class="T_BGColor_2"></td></tr></table></td>
<td width="475" height="28" class="T_TD_BGColor_2_2" align="center" valign="top"><table border="0" width="97%" height="10" cellspacing="0" cellpadding="0"><tr><td height="8"></td></tr><tr><td height="10"><font class="BlackS12"><%=rsGB8("Co_GuestbookNoteText")%></font></td></tr><tr><td height="6"></td></tr></table></td>
</tr>
</table>
<br>
<%
end if
rsGB8.close
set rsGB8=Nothing
end if
end if
else
Response.write "<table border=""0"" cellpadding=""0"" cellspacing=""1"" width=""558"" height=""80"" class=""T_BGColor_2""><tr><td class=""T_TD_BGColor_2_2"" align=""center""><img src=""Style/"&WebSiteStyle&"/Title_07.gif"" width=""60"" height=""60"" border=""0"" align=""absmiddle""> <font class=""MaroonS12"">数据获取失败,没有找到相关数据</font></td></tr></table><br><br>"
end if
else
Response.write "<table border=""0"" cellpadding=""0"" cellspacing=""1"" width=""558"" height=""80"" class=""T_BGColor_2""><tr><td class=""T_TD_BGColor_2_2"" align=""center""><img src=""Style/"&WebSiteStyle&"/Title_07.gif"" width=""60"" height=""60"" border=""0"" align=""absmiddle""> <font class=""MaroonS12"">抱歉,用户留言功能已关闭,请联系网站管理员</font></td></tr></table><br><br>"
end if
%></td>
</tr>
</table></td>
</tr>
</table>
</center>
<!--#include file="Include/Bottom.asp"-->
</body>
</html>
<%CloseDatabase%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -