下面是我做的代码,请看看要加什么代码,加在哪里?
<%
' FP_ASP FrontPage 组件自动产生 ASP 。请勿编辑。
On Error Resume Next
Session("FP_OldCodePage") = Session.CodePage
Session("FP_OldLCID") = Session.LCID
Session.CodePage = 936
Err.Clear
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "无法创建连接"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "无法创建记录集"
fp_conn.Open Application("new_page_1_ConnectionString")
FP_DumpError strErrorUrl, "无法打开数据库"
fp_rs.Open "结果", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "无法打开记录集"
fp_rs.AddNew
FP_DumpError strErrorUrl, "无法将新记录集添加到数据库"
Dim arFormFields0(11)
Dim arFormDBFields0(11)
Dim arFormValues0(11)
arFormFields0(0) = "T2"
arFormDBFields0(0) = "T2"
arFormValues0(0) = Request("T2")
arFormFields0(1) = "D3"
arFormDBFields0(1) = "D3"
arFormValues0(1) = Request("D3")
arFormFields0(2) = "T3"
arFormDBFields0(2) = "T3"
arFormValues0(2) = Request("T3")
arFormFields0(3) = "R1"
arFormDBFields0(3) = "R1"
arFormValues0(3) = Request("R1")
arFormFields0(4) = "T4"
arFormDBFields0(4) = "T4"
arFormValues0(4) = Request("T4")
arFormFields0(5) = "T5"
arFormDBFields0(5) = "T5"
arFormValues0(5) = Request("T5")
arFormFields0(6) = "T6"
arFormDBFields0(6) = "T6"
arFormValues0(6) = Request("T6")
arFormFields0(7) = "T7"
arFormDBFields0(7) = "T7"
arFormValues0(7) = Request("T7")
arFormFields0(8) = "D1"
arFormDBFields0(8) = "D1"
arFormValues0(8) = Request("D1")
arFormFields0(9) = "T1"
arFormDBFields0(9) = "T1"
arFormValues0(9) = Request("T1")
arFormFields0(10) = "D2"
arFormDBFields0(10) = "D2"
arFormValues0(10) = Request("D2")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "远程计算机名称"
End If
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "用户名"
End If
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "浏览器类型"
End If
FP_SaveFieldToDB fp_rs, Now, "时间戳"
fp_rs.Update
FP_DumpError strErrorUrl, "无法更新数据库"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=gb2312",_
"表单确认",_
"感谢您提交下列信息:",_
"zhanghao.asp",_
"返回到表单。"
End If
End If
Session.CodePage = Session("FP_OldCodePage")
Session.LCID = Session("FP_OldLCID")
%>
<html>
ASP网页表单做好了,数据库连接好了,还要加什么代码才能把数据保存到数据库
答案:2 悬赏:0 手机版
解决时间 2021-04-29 10:04
- 提问者网友:杀生予夺
- 2021-04-29 04:04
最佳答案
- 五星知识达人网友:洎扰庸人
- 2021-04-29 04:39
直接把:<form method="POST" action="--WEBBOT-SELF--">
改成:<form method="POST" action="?">
就可以了,简单吧!
改成:<form method="POST" action="?">
就可以了,简单吧!
全部回答
- 1楼网友:第四晚心情
- 2021-04-29 05:02
在最后面加上 阿媒有黑痣。 就可以了
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯