📄 message.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% Option Explicit %>
<%
dim db
db=1
%>
<!-- 前台留言及显示 -->
<!-- #include file="config/db.asp" -->
<!-- #include file="config/function.inc.asp" -->
<!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" />
<title>留言</title>
<link href="css/mycss.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<body>
<div align="center">
<%
'----------------------------处理添加留言动作-------------------------
dim sql,rst,page,pagelistnum,myErrors
set rst=server.createobject("adodb.recordset")
if request.querystring("act")="add" then
if trim(request.form("f_title"))="" or trim(request.form("f_content"))="" or session("s_loginID")="" then
msgboxU "添加留言出错,您可能没有填写留言主题或留言内容,或者您不是注册用户或未登录!"
else
sql="shop_message"
rst.open sql,conn,1,3
rst.addnew
rst("m_title")=request.form("f_title")
rst("m_content")=request.form("f_content")
rst("m_uid")=session("s_loginID")
rst("m_check")=False
rst.update
rst.close
set myErrors=conn.errors
if myErrors.count=0 then
msgboxU("留言"&request.form("m_title")&"成功!请等待管理员审核!")
else
msgboxU("留言失败!原因:"&myErrors.item(0).description)
end if
end if
end if
%>
<%
'-------------------------------显示留言列表-------------------------------
pagelistnum=5
if request.querystring("page")="" then
page=1
else
page=request.querystring("page")
end if
sql="select top "&(page*pagelistnum)&" shop_message.*,shop_user.u_name from shop_user,shop_message where shop_message.m_uid=shop_user.u_id and shop_message.m_check=true"
if request.querystring("m_id")<>"" then sql=sql & " and shop_message.m_id=" & request.querystring("m_id")
sql=sql&" order by m_id desc"
rst.open sql,conn,1,1
if rst.eof and rst.bof then
response.write("还没有任何何人留言,或是没有任何留言被审核通过!")
else
rst.PageSize=pagelistnum
rst.AbsolutePage=page
do while not rst.eof
%>
<table width="754" height="132" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666">
<tr>
<td bgcolor="#99CCFF">第[<span class="STYLE1"><%=rst("m_id")%></span>]楼 留言人:<%=rst("u_name")%></td>
<td bgcolor="#99CCFF">留言时间:<%=rst("m_adddate")%></td>
</tr>
<tr>
<td colspan="2" bgcolor="#DDDDDD">标题:<%=rst("m_title")%></td>
</tr>
<tr>
<td height="48" colspan="2" bgcolor="#DDDDDD">内容:<%=rst("m_content")%></td>
</tr>
<tr>
<td height="24" colspan="2" bgcolor="#DDDDDD">回复:<%=rst("m_recontent")%></td>
</tr>
<tr>
<td height="16" colspan="2"><div align="center"></div></td>
</tr>
</table>
<%
rst.movenext
loop
if request.querystring("m_id")<>"" then
else
sql="select count(*) as num from shop_message,shop_user where shop_message.m_uid=shop_user.u_id and shop_message.m_check=true"
fy sql,page,pagelistnum,"message.asp?t="
end if
response.Write("<br>")
rst.close
end if
%>
<!--显示留言表单begin-->
<%
if session("s_loginUSER")="" then
response.write("您还没有登录,所以不能发言,点击<a href='index.asp'>这里</a>登录!")
else
%>
</div>
<form id="form1" name="form1" method="post" action="message.asp?act=add">
<div align="center">
<table width="754" height="293" border="1" cellpadding="0" cellspacing="0" bordercolor="#666666">
<tr>
<td colspan="2"><div align="center">用户<%=session("s_loginUSER")%>填写留言</div></td>
</tr>
<tr>
<td width="131" valign="top">留言主题</td>
<td width="553" valign="middle"><input name="f_title" type="text" id="f_title" size="82" /></td>
</tr>
<tr>
<td height="189" valign="top">留言内容</td>
<td valign="top"><textarea name="f_content" cols="80" rows="12" id="f_content"></textarea></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="提交留言" />
<input type="reset" name="Submit2" value="重置" />
</div></td>
</tr>
</table>
</div>
</form>
<%
end if
set rst=nothing
conn.close
set conn=nothing
%>
<!--显示留言表单end-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -