Microsoft VBScript 运行时错误
错误 '800a0009' 下标越界: '[number: 1]'
/GuestBook/GuestBook_Save.asp,行 51
我是在留言的时候 出现的这个问题 我用的是4.5的 还没升级 问题是升级后出现了更多问题
就是在我填写好内容的时候 点发表的时候出现的
遇到这个问题怎么解决啊
谁可以把这个文件传给我一个 我替换试下
郁闷的很 就是找不到解决办法
下面这个就是GuestBook_Save.asp 问题内容了
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<!--#include file="../Conn.asp"-->
<!--#include file="../KS_Cls/KS.PublicCls.asp"-->
<%
'****************************************************
' Software name:Kesion CMS 4.5
' Email: service@kesion.com . QQ:111394,9537636
' Web: http://www.kesion.com http://www.kesion.cn
' Copyright (C) Kesion Network All Rights Reserved.
'****************************************************
Dim KSCls
Set KSCls = New Guest_SaveData
KSCls.Kesion()
Set KSCls = Nothing
Class Guest_SaveData
Private KS
Private Name, Email, Subject, Oicq, Verifycode, IP, Pic, TxtHead, HomePage, Memo, ErrorMsg, a
Private GuestNum
Private Sub Class_Initialize()
Set KS=New PublicCls
End Sub
Private Sub Class_Terminate()
Call CloseConn()
Set KS=Nothing
End Sub
Public Sub Kesion()
Dim TmpIsSelfRefer,I,SplitStrArr
GuestNum=KS.Setting(54)
TmpIsSelfRefer = IsSelfRefer()
If TmpIsSelfRefer <> TRUE Then '外部提交的数据
Call KS.AlertHistory("数据提交错误!",-1)
End If
Dim LastLoginIP:LastLoginIP = KS.GetIP
Name = KS.S("Name")
Email = KS.S("Email")
HomePage = KS.S("HomePage")
Oicq = KS.ChkClng(KS.S("Oicq"))
Verifycode = KS.S("Code")
IP = LastLoginIP
Pic = KS.S("Pic")
TxtHead = KS.S("txthead")
Subject = KS.S("Subject")
Memo = KS.S("Memo")
SplitStrArr=split(KS.Setting(55),vbCrlf)
For I=0 To Ubound(SplitStrArr)
Memo=Replace(Memo,Split(SplitStrArr(I),"=")(0),Split(SplitStrArr(I),"=")(1))
Next
a = CheckEnter()
If a = True Then
SaveData()
Response.Write("<script>alert('谢谢您的留言,我们会尽快给您答复!');location.href='Index.asp';</script>")
Else
Call KS.AlertHistory(ErrorMsg,-1)
End If
End Sub
Function CheckEnter()
IF Trim(Verifycode)<>Trim(Session("Verifycode")) And KS.Setting(53)=1 then
CheckEnter=False
Response.Write("<script>alert('验证码有误,请重新输入!');history.back();</script>")
Else
If Name="" Then
CheckEnter=False
ErrorMsg="你好像忘了填“昵称”!"
Else
If Email="" or InStr(2,Email,"@")=0 Then
CheckEnter=False
ErrorMsg="你的Email有问题请重新填写!"
Else
If Pic="" Then
CheckEnter=False
ErrorMsg="你的头像没选,选一个把!"
Else
If TxtHead="" Then
CheckEnter=False
ErrorMsg="你的表情没选,选一个把!"
Else
If Memo="" or Len(Trim(Memo)) > KS.ChkClng(GuestNum) Then
CheckEnter=False
ErrorMsg="留言不能为空并且不能超过"& KS.ChkClng(GuestNum) &"字,重新来吧!"
Else
CheckEnter=TRUE
End If
End If
End If
End If
End If
End If
End Function
Sub SaveData()
Dim SqlStr:SqlStr = "SELECT * From KS_GuestBook WHERE ID IS NULL"
Dim RSObj:Set RSObj=Server.CreateObject("Adodb.RecordSet")
RSObj.Open SqlStr,Conn,1,3
RSObj.AddNew
RSObj("Name") = KS.HTMLEncode(Name)
RSObj("Email") = KS.HTMLEncode(Email)
RSObj("HomePage") = KS.HTMLEncode(HomePage)
RSObj("Face") =Pic&".gif"
RSObj("TxtHead") = "Face" & TxtHead&".gif"
RSObj("Subject") = KS.HTMLEncode(Subject)
RSObj("Memo") = KS.HTMLEncode(Memo)
RSObj("Oicq") = KS.HTMLEncode(Oicq)
RSObj("GuestIP") = IP
RSObj("Anser")=""
RSObj("AddTime") = Now()
RSObj.Update
RSObj.Close
Set RSObj = Nothing
End sub
' ============================================
' 检测上页是否从本站提交
' 返回:True,False
' ============================================
Function IsSelfRefer()
Dim sHttp_Referer, sServer_Name
sHttp_Referer = CStr(Request.ServerVariables("HTTP_REFERER"))
sServer_Name = CStr(Request.ServerVariables("SERVER_NAME"))
If Mid(sHttp_Referer, 8, Len(sServer_Name)) = sServer_Name Then
IsSelfRefer = True
Else
IsSelfRefer = False
End If
End Function
End Class
%>