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

📄 addsave.asp

📁 东营人家多用户留言本 2.2 版 留言本演示地址:http://www.860546.net/gbook/index.asp 留言本下载地址:http://www.860546.net/8
💻 ASP
字号:
<%user=request("user")
if user<>"" then%> 
<!--#include file="config.asp"-->
<!--#include file="char.asp"-->
<%
face=request.form("images")
if request.form("images")="" then
face="1"
end if
name=htmlencode(request.form("name"))
if name="" then
name="过客"
end if
email=request.form("email")
url=request.form("url")
if url="http://" then
url=""
end if
qq=request.form("qq")
ip=Request.ServerVariables("REMOTE_HOST")
show=request.form("show")
ly=htmlencode(request.form("ly"))

if email="<a href=" or  url="<a href=" or email="<hr>" or url="<hr>" or email="<a href" or url="<a href" or email="target"  or url="target" then
errmsg=errmsg & "△ 请不要输入非法字符!\n"
end if

If email<>"" then
dim email1,email2
email1=Split(email, "@")
email2=Split(email, ".")
if UBound(email1) <> 1 or UBound(email2) = 0 then
errmsg=errmsg & "△ 请正确输入Email!\n"
end if
end if

If url<>"" then
dim url
home=Split(url, ".")
if UBound(home) <> 1 and UBound(home) <> 2 and UBound(home) <> 3 and UBound(home) <> 4 then
errmsg=errmsg & "△ 请正确输入主页!\n"
end if
end if

if len(name)>10 or len(email)>20 or len(url)>30 or len(qq)>12 or len(ly)>100  then 
errmsg=errmsg & "△ 输入信息过长! \n"
end if

'**********检查是否填写了所有项,如果不是侧自动返回申请页面
if ly="" then
errmsg=errmsg & "△ 请填写留言[内容]!\n"
end if
if request.cookies("ly")=ly then
errmsg=errmsg & "△ 请不要重复提交相同的留言!\n"
end if

if errmsg<>"" then
    Conn.Close
    Set conn = nothing
    Set rsc = nothing
    response.write("<script>alert('" & errmsg & "');history.go(-1)</script>")
    response.end
end if
'**********检查结束**********
response.cookies("ly")=ly

set rs=server.createobject("adodb.recordset")
sql="select * from book where (id is null)" 

rs.open sql,conn,1,3
rs.addnew
rs("user")=user
rs("name")=name
rs("face")=face
rs("email")=email
rs("url")=url
rs("qq")=qq
rs("ip")=ip
rs("show")=show
rs("ly")=ly

rs.update

rs.close
set rs=nothing  
conn.close     
set conn=nothing
%>
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Refresh" content="2; URL=index.asp?user=<%=user%>">
<title>添加留言</title>
<link href="style.css" rel="stylesheet" type="text/css">
</head>

<body background="pic/a1bf.gif">
<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%"> 
      <p align="center"><img src="pic/mai2n.gif" width="361" height="251" border="1"></p>
      <p align="center"><font size="3">提交成功!</font></p>
      <p align="center">2 秒后自动<a href="index.asp?user=<%=user%>">返回留言本</a>···<br>
        <br>
        <br>
    </td>
  </tr>
</table>
</body><%end if%>              
</html>             

⌨️ 快捷键说明

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