⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hf.asp

📁 简单的留言版asp原码,供学习参考,里边有详细说明
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="check.asp"-->
<%
if session("bxgzsadmin")<>"" then
guest="yes"
end if
if guest<>"yes" then
response.write "<script>alert('游客禁止回复');location.href='javascript:history.back()'</script>"
response.end
end if
if request("id")="" then
response.write "<script>alert('参数错误');location.href='javascript:history.back()'</script>"
response.end
end if
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from book where id="&clng(request("id"))
set rs=conn.execute(sql)
if rs.eof then
rs.close
set rs=nothing
response.write "<script>alert('参数错误');location.href='javascript:history.back()'</script>"
response.end
end if
%>
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<title><%=title%></title>
<body style="word-break:break-all">
<center>
<table border="0" width="330" height="45" cellspacing="1" bordercolorlight="#FFFFFF" bordercolordark="#C0C0C0" cellpadding="0">
<tr>
<td width="330" height="1" colspan="2" align="center">
<table><tr>
<td>时间:<%=left(rs("time"),10)%>&nbsp;&nbsp;姓名:<%=rs("Username")%>&nbsp;&nbsp;MAIL:<a href=mailto:<%=rs("mail")%>><%=rs("mail")%></a></td></tr>
<tr>
<TD>HOMEPAGE:<a href=http://<%=rs("home")%>><%=rs("Home")%></a></TD>
</tr>
<tr><td width=90%>留言内容:<BR><%=rs("Ly")%><br><hr noshade size=1 width='100%'color='#666666'></td>           
</tr></table>
</td>
    </tr>
    <tr><form method="post" action="hf.asp?action=hf&id=<%=rs("id")%>">
      <td width="330" height="1" align="center">留言回复:<br>      
<textarea cols="33" name="HF" rows="5" wrap="VIRTUAL" style="font-size: 12"></textarea>
      </td>
    </tr>
<tr>
<td width="330" height="1" align="center" colspan="2">
<input type="submit" value="完  成" style="font-size: 12" name="submit">
<input type="reset" name="Submit" value="清 除"></td></form>
    </tr>
  </table>
</center>
</body>
</html>
<%
rs.close
set rs=nothing
Select Case Request("action")
  Case "hf"
   Call work_hf
End Select
sub work_hf
set rs=server.CreateObject("ADODB.RecordSet")
sql="select * from hf"
rs.open sql,conn,1,3
if session("bxgzsadmin")<>"" then
name="<font color=red>管理员</font>"
else
name="<font color=#008800>游客</font>"
end if
BH=clng(request("id"))
HF=inohtml(request.form("HF"))
shijian1=formatdatetime(now(),1)
if instr(HF,"<br>"&chr(10)&"<br>"&chr(10)&"<br>")<>0 then
response.write "<script>alert('请少量输入换行符');"
response.write "location.href='javascript:history.back()'</script>"
response.end
end if
countHF=split(HF,"<br>")
if ubound(countHF)>15 then
response.write "<script>alert('回车符超过最大限制15个');"
response.write "location.href='javascript:history.back()'</script>"
response.end
end if
if Hf="" then
response.write"<script>alert('您没回复');location.href='javascript:history.go(-2)'</script>"
response.end
end if
if len(hf)>Num then
response.write"<script>alert('信息过长');location.href='javascript:history.back()'</script>"
response.end
end if
rs.addnew
Application.Lock
rs("BH")=BH
rs("HF")=HF
rs("name")=name
rs("time")=shijian1
rs.update
Application.Unlock
rs.close
set rs = nothing
conn.close
set conn = nothing
response.redirect "index.asp"
response.end
end sub
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -