我的系统是XP SP3,网点根目录的权限也设置了。就是不行。我在网上找答案已经找了两天,都没有解决。请高手帮帮我,非常感谢! 代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%><!--#include file="Connections/conn.asp" --><%' *** Edit Operations: declare variables
Dim MM_editActionDim MM_abortEditDim MM_editQueryDim MM_editCmd
Dim MM_editConnectionDim MM_editTableDim MM_editRedirectUrlDim MM_editColumnDim MM_recordId
Dim MM_fieldsStrDim MM_columnsStrDim MM_fieldsDim MM_columnsDim MM_typeArrayDim MM_formValDim MM_delimDim MM_altValDim MM_emptyValDim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))If (Request.QueryString <> "") Then MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)End If
' boolean to abort record editMM_abortEdit = false
' query string to executeMM_editQuery = ""%><%' *** Insert Record: set variables
If (CStr(Request("MM_insert")) = "form1") Then
MM_editConnection = MM_conn_STRING MM_editTable = "t_message" MM_editRedirectUrl = "index.asp" MM_fieldsStr = "t_name|value|t_message|value|t_time|value" MM_columnsStr = "t_name|',none,''|t_message|',none,''|t_time|',none,NULL"
' create the MM_fields and MM_columns arrays MM_fields = Split(MM_fieldsStr, "|") MM_columns = Split(MM_columnsStr, "|") ' set the form values For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i))) Next
' append the query string to the redirect URL If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString Else MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString End If End If
End If%><%' *** Insert Record: construct a sql insert statement and execute it
Dim MM_tableValuesDim MM_dbValues
If (CStr(Request("MM_insert")) <> "") Then
' create the sql insert statement MM_tableValues = "" MM_dbValues = "" For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2 MM_formVal = MM_fields(MM_i+1) MM_typeArray = Split(MM_columns(MM_i+1),",") MM_delim = MM_typeArray(0) If (MM_delim = "none") Then MM_delim = "" MM_altVal = MM_typeArray(1) If (MM_altVal = "none") Then MM_altVal = "" MM_emptyVal = MM_typeArray(2) If (MM_emptyVal = "none") Then MM_emptyVal = "" If (MM_formVal = "") Then MM_formVal = MM_emptyVal Else If (MM_altVal <> "") Then MM_formVal = MM_altVal ElseIf (MM_delim = "'") Then ' escape quotes MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'" Else MM_formVal = MM_delim + MM_formVal + MM_delim End If End If If (MM_i <> LBound(MM_fields)) Then MM_tableValues = MM_tableValues & "," MM_dbValues = MM_dbValues & "," End If MM_tableValues = MM_tableValues & MM_columns(MM_i) MM_dbValues = MM_dbValues & MM_formVal Next MM_editQuery = "insert into " & MM_editTable & " (" & MM_tableValues & ") values (" & MM_dbValues & ")"
If (Not MM_abortEdit) Then ' execute the insert Set MM_editCmd = Server.CreateObject("ADODB.Command") MM_editCmd.ActiveConnection = MM_editConnection MM_editCmd.CommandText = MM_editQuery MM_editCmd.Execute MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then Response.Redirect(MM_editRedirectUrl) End If End If
End If%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head>
<body><form method="post" action="<%=MM_editAction%>" name="form1"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">留言人</td> <td><input type="text" name="t_name" value="" size="32"> </td> </tr> <tr> <td nowrap align="right" valign="top">留言内容</td> <td valign="baseline"><textarea name="t_message" cols="50" rows="5"></textarea> </td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="插入记录"> </td> </tr> </table> <input type="hidden" name="t_time" value="<%= Now() %>" > <input type="hidden" name="MM_insert" value="form1"></form><p> </p></body></html>
9 个解决方案
#1
楼主你这样发的代码怎么看啊 发个HTML的
#2
omg!
#3
佩服哈。。。
#4
#5
o shit!
#6
找个没事做的哥们帮你慢慢分析
#7
一步一步的检测,页面上的就Resopnse.数据库的就吧语句带进去扫。。。
#8
楼主你敢再乱点么?
#9
#1
楼主你这样发的代码怎么看啊 发个HTML的
#2
omg!
#3
佩服哈。。。
#4
#5
o shit!
#6
找个没事做的哥们帮你慢慢分析
#7
一步一步的检测,页面上的就Resopnse.数据库的就吧语句带进去扫。。。
#8
楼主你敢再乱点么?