这是我的处理存入数据库的文件
<%@LANGUAGE="VBSCRIPT" 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" />
<script type="text/javascript" language="javascript">
var Default_isFT = 1
//默認是否繁,0-簡體,1-繁體
</script>
<!--#include file="../include/conn.asp"-->
<!--#include file="../include/Fy_SqlX.Asp" -->
<%session("url")=request.ServerVariables("HTTP_REFERER")
function encode(str)
str=replace(str,chr(13),"<br>")
encode=replace(str,chr(32)," ")
end function
function uncode(str)
str=replace(str,"<br>",chr(13))
uncode=replace(str," ",chr(32))
end function
'--------禁止從站外部提交數据------
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("name")="" Then
Response.Write"<br><center><font color=#ff0000>數據意外丟失![<a href='javascript:history.go(-1)'>返回</a>]</font></center>"
Response.End
End If
%>
<%
days=trim(request("days"))
months=trim(request("months"))
years=trim(request("years"))
purchasedate=years & "-" & months & "-" & days
brands=trim(request("brands"))
model=trim(request("model"))
Serial_No=trim(request("Serial_No"))
Dealer_name=trim(request("Dealer_name"))
purchasedate=purchasedate
name=trim(request("name"))
province1=trim(request("province1"))
city1=trim(request("city1"))
address=trim(request("address"))
address=province1 & city1 & address
Telephone=trim(request("Telephone"))
email=trim(request("email"))
occupation=trim(request("occupation"))
findProducts=trim(request("findProducts"))
dealers=trim(request("dealers"))
comment=encode(request("comment"))
%>
<%
if brands="" then brands=null
if model="" then model=null
if Serial_No="" then Serial_No=null
if Dealer_name="" then Dealer_name=null
if purchasedate="" then purchasedate=null
if name="" then name=null
if address="" then address=null
if Telephone="" then Telephone=null
if email="" then email=null
if occupation="" then occupation=null
if findProducts="" then findProducts=null
if dealers="" then dealers=null
if comment="" then comment=null
%>
<a id="StranLink">繁体</a>
<script type="text/javascript" src="../inc/s2t.js" charset="gbk"></script>
<%
Set rs=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM MS_services"
rs.Open sql,conn,1,3
rs.Addnew
rs("brands")=brands
rs("model")=model
rs("Serial_No")=Serial_No
rs("Dealer_name")=Dealer_name
rs("purchasedate")=purchasedate
rs("name")=name
rs("address")=address
rs("Telephone")=Telephone
rs("email")=email
rs("occupation")=occupation
rs("findProducts")=findProducts
rs("dealers")=dealers
rs("comment")=comment
rs.Update
rs.Close
Set rs=Nothing
response.write "<SCRIPT language=JavaScript>alert('您所填寫的保修注冊表已成功提交,謝謝!');"
response.write "this.location.href='"& session("url") & "';</SCRIPT>"
%>
</head>
</html>