不好意思,复制的时候少了
[bo][un]tianyu123[/un] 在 2008-5-26 12:05 的发言:[/bo]
rs.Update要加在rs.close之前
rs.Update
rs.Close
cus.asp 整个文件内容
<%@CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.
<html xmlns="http://www.
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<!--#include file="../include/conn.asp"-->
<script type="text/javascript" language="javascript">
var Default_isFT = 1 //默认是否繁体,0-简体,1-繁体
</script>
<%
session("url")=request.ServerVariables("HTTP_REFERER")
server_vv=len(Request.ServerVariables("SERVER_NAME"))
server_v1=left(Cstr(Request.ServerVariables("HTTP_REFERER")),server_vv)
server_v2=left(Cstr("http://"&Request.ServerVariables("SERVER_NAME")),server_vv)
if server_v1<>server_v2 or server_v1="" or server_v1="" then
response.write("<script>alert('警告:禁止從站外部提交數据!')</script>")
response.end
end if
If Request("biaoti")="" Then
Response.Write"<br><center><font color=#ff0000>數據意外丟失![<a href='javascript:history.go(-1)'>返回</a>]</font></center>"
Response.End
End If
biaoti=trim(request("biaoti"))
namee=trim(request("namee"))
add=trim(request("add"))
phone=trim(request("phone"))
email=trim(request("email"))
content=trim(request("content"))
if len(biaoti)>100 or len(biaoti)<3 then
response.write "<script language='javascript'>" & chr(13)
response.write "alert('標題文字應在3-100個字符之間!');" & Chr(13)
response.write "window.document.location.href='in_customermessagex.asp';"&Chr(13)
response.write "</script>" & Chr(13)
Response.End
End if
%>
</head>
<body>
<a id="StranLink"></a>
<script type="text/javascript" src="s2t.js" charset="gbk"></script>
<%
Set rs=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM MS_luiyanbiao"
rs.Open sql,conn,1,3
rs.Addnew
rs("biaoti")=biaoti
rs("namee")=namee
rs("add")=add
rs("phone")=phone
rs("email")=mail
rs("content")=content
rs.Update
rs.Close
Set rs=Nothing
response.write "<SCRIPT language=JavaScript>alert('提交成功');"
response.write "this.location.href='"& session("url") & "';</SCRIPT>"
response.Redirect "in_customermessage.asp" %>
</body>
</html>