下标越界问题

longjunyu00 2010-04-07 12:58:09
各位大侠们帮我看下这是怎么回事?
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../Class/class.asp" -->
<!--#include file="../Class/Member.Asp" -->

<!--#include file="../inc/page.asp"-->

<!--#include file="../Class/MD5.Asp" -->
<%
Dim Sql,Rs
dim action:action=Trim(Request("action"))
dim RedirectURL:RedirectURL=Trim(Request("RedirectURL"))
dim StrValue:StrValue=Trim(Request("StrValue"))
if Request("action")="esc" then
Session.abandon
Response.Redirect("Login.Asp")
end if


if action = "login" then
dim adminname,PassWord,adminpwd
adminname = Com.FiltStr(trim(request.form("name")))
PassWord=Com.FiltStr(trim(request.form("pass")))
AdminPwd=MD5(PassWord)

if adminname="" and adminpwd="" then
founderr=true
Response.write "请输入用户名或密码!"
end if



sql="select * from tbl_Client_Info where UserName='"& adminname &"' and PassWord='"&AdminPwd&"'"

Set Rs=DataBase.Opens(Sql,2,3)
if rs.eof and rs.bof then

else
if rs("PassWord")<>AdminPwd then

end if

rs("LoginTime")=Now()
rs.Update
session("Member_Client_Name")=rs("UserName") '登陆名称
session("Member_Client_Id")=rs("id") '登陆编号
session.timeout=50
dim msg
msg= "<script>alert('登录成功');location.href='../Member/MemberEdit.asp';</script>"
end if

end if
%>


<%
Member.Check()
'Dim sql,Rs,action
DataBase.Data_Number=2
%>
<!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>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="style/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../Jscript/function.js"></script>
<link href="../Web/css/css.css" rel="stylesheet" type="text/css" />
</head>

<body>

<%= msg %>
<script language="javascript">
<!--
function user_login() {
aa=document.form1 ;
if (aa.name.value=="")
{
alert("登录帐号没有填写!");
aa.name.focus();
return false;
}
if (aa.pass.value.length<6)
{
alert("登录密码没有填写或不正确!");
aa.pass.focus();
return false;
}


}
function user_login_fun(str)
{
aa=document.form1 ;
rurl="../Member/MemberEdit.asp";
if(aa.urls.value!=""){ rurl= aa.urls.value;}
if (str=="Yes"){
alert("登陆成功!");
if(aa.StrValue.value!=""){
document.regForm.action= rurl;
document.regForm.StrValue.value= aa.StrValue.value;
document.regForm.submit();
}else{
location.href = rurl;
}
}else{
alert("您输入的密码不正确!");
}
}
//-->
</script>

<link href="Style/Style.css" rel="stylesheet" type="text/css" />
<script language="javascript">
function RedirectUrl(show_status,id,elongprice){
if (show_status != "0"){
window.location.href="Store_Order.Asp?Id="+id;
}else{
alert('对不起,此商品暂时库存为0,请选购其他物品!')
}
}
</script>
<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" class="Memberbg">
<tr>
<td valign="top" width="30"></td>
<td width="245" valign="top">
<!--#include file="left.asp" -->
</td>
<td valign="top"><table width="672" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30"></td>
</tr>
<tr>
<td align="right"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="523"> </td>
<td align="right"><a href="en/index.asp"><img src="../Web/images/index_091.png" height="13" /></a></td>
<td align="center"><a href="../Web/index.asp"><img src="../Web/images/index_051.png" height="13" /></a></td>
</tr>
</table></td>
</tr>
<tr>
<td height="45"></td>
</tr>
</table>

<form name='regForm' method='post' action=''><input name='StrValue' type='hidden'></form>
<form name="form1" method="post" action="" >
<table width="672" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="28"><table width="100%" border="0" cellpadding="0" cellspacing="0" class="font12-whitestrong">
<tr>
<td style="font-size:14px;color:#000000;"><div id="dv" name="dv">欢迎<%=session("Member_Client_Name")%>光临</div></td>
<td style="font-size:14px;color:#000000;">
<%If session("Member_Client_Name")<>"" Then%>
<a href='exit.asp' style='font-size:14px;color:#000000;'>退 出</a> <%Else%>
<a href='../member/login.asp' style='font-size:14px;color:#000000;'>登 录</a> <%End If %></td><td style="font-size:14px;color:#000000;"><a href="../Member/register.asp" style="font-size:14px;color:#000000;" onclick=''>注 册</a></td>
<td width="40" align="center" style="color:#000000;">搜索</td>
<td width="116"><input name="textfield3" type="text" class="border" id="textfield3" style="width:110px; height:13px; filter:progid:DXImageTransform.Microsoft.gradient(startcolorstr=#2f2f2f,endcolorstr=#424242,gradientType=1)"/></td>
</tr>
</table></td>
</tr>
<tr>
<td bgcolor="#c4c5c4" height="1"></td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
</form>




<div style="width:672px; float:left; padding-left:10px;"> <table width="672" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="522" height="460" valign="top" bgcolor="#8f9092" style="filter:alpha(opacity=80)">


<div id="right">
<div id="member_query" style="padding-top:10px; padding-left:10px;">
<form name="query" method="post" action="?">
条件:
<select name="Where" id="Where">
<option value="Store_Name">奖品名称</option>
<option value="jifen">积分数</option>
</select>
关键字: <input name="KeyWord" type="text" id="KeyWord" size="20">
<input name="Submit3" type="submit" id="Submit3" value="查找">
</form>
</div>
<div id="store_box">
<ul><li style="padding:0px; padding-left:5px;">按积分数量查询: <a href="?jifen=0$200" class="a_blue_u">200分及以下</a>  <a href="?jifen=201$500" class="a_blue_u">201-500分</a>  <a href="?jifen=501$1000" class="a_blue_u">501-1000分</a>  <a href="?jifen=1001$5000" class="a_blue_u">1001-5000分</a>  <a href="?jifen=5001$0" class="a_blue_u">5000分以上</a></li></ul>
<ul><li style="padding:0px; padding-left:5px;">按礼品类别查询:

<%
Dim rc
Sql="Select Gift_Type From tbl_Store_Gift_Type Order By Id asc"
Set Rc=DataBase.Opens(Sql,1,1)
Do While not Rc.Eof
Response.Write Rc("Gift_Type")
Rc.MoveNext
Loop
%>
</li></ul>
</div>
<%
dim Where,KeyWord,I,jifen,gtype
Where=Request("Where")
KeyWord=Request("keyword")
jifen=Request("jifen")
gtype=Request("gtype")
sql=""
if KeyWord<>"" then
if Where="jifen" then
sql=sql&" and jifen<"&KeyWord
end if
if Where="Store_Name" then
sql=sql&" and Name like '%"&KeyWord&"%'"
end if
end if
if jifen<>"" then
if split(jifen,"$")(0)<>"0" then
sql=sql&" and jifen >="&split(jifen,"$")(0)&""
end if
if split(jifen,"$")(1)<>"0" then
sql=sql&" and jifen <="&split(jifen,"$")(1)&""
end if
end if
if gtype<>"" then
sql=sql&" and Bigclass ='">ype&"'"
end if

Page.Page_Size=12 '每页显示的记录条数
Page.Current_Page = Cint(Request.QueryString("Page")) '当前页码
Page.DataBase_Name ="tbl_Store_Gift_Info" '数据表名
Page.DataBase_Field="*"'字段
Page.DataBase_Where= "1=1 "&Sql&" Order By Id Asc"
Page.Page_Url="Store.Asp" '连接地址
Dim RecordId : RecordID=Page.Count_Id(false)
if RecordId="1" then
response.write("<div align=center><br><br><br><font color=red>没有找到符合查询条件的信息!</font><br><br><br></div>")
else
sql="select "&Page.DataBase_Field&" from "&Page.DataBase_Name&" where Id In ("&RecordId&") Order By Id Asc"
set Rs=DataBase.Opens(sql,1,1)
%>
<div id="member_box">
<%
dim N,J
for N=1 to int(Rs.RecordCount/3)+1
Response.Write "<ul>"
for j=1 to 3
if Rs.eof then Exit for
Response.Write "<li><div class=""store""><ul><a href=""Store_Info.Asp?Id="&Rs("Id")&"""><img src=""../UpPhoto/square/"&Rs("Img")&""" width=""90"" height=""90"" class=""pimg""></a></ul><ul>"&Rs("Name")&"</ul><ul>需要 <span style=""color:#FF0000;"">"&Rs("jifen")&"</span> 积分</ul><ul><a href=""javascript:RedirectUrl('"&rs("shuliang")&"','"&rs("id")&"','"&rs("jifen")&"');""><img src=""Images/jien_37.gif"" width=""85"" height=""20"" border=""0""></a></ul></div></li>"
Rs.MoveNext
next
Response.Write "</ul>"
Next
%>
</div>
<div id="member_page"><%=Page.Page_List(false) %></div>
<%end if%>
</div>



</td>
</tr>
<tr>
<td height="6"></td>
</tr>
</table></div>
<!--#include file="../foot.asp"--></td>
</tr>
</table>
</body>
</html>
...全文
173 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
longjunyu00 2010-04-07
  • 打赏
  • 举报
回复
一下就是所出的问题
Microsoft VBScript ����ʱ���� ���� '800a0009'

�±�Խ��: '[number: 1]'

F:\WORK\DDWANT\MEMBER\../Class/class.asp���� 48
后浪 2010-04-07
  • 打赏
  • 举报
回复
变量超过了你数组定义的范围..
灬上海爽爷 2010-04-07
  • 打赏
  • 举报
回复
LS正解,比如a="12,34"
a=split(a,",")
a(0),a(1)输出都没问题
如果输出a(2)就是下标越界了。LZ仔细检查下吧。
灬上海爽爷 2010-04-07
  • 打赏
  • 举报
回复
LS正解,比如a="12,34"
a=split(a,",")
a(0),a(1)输出都没问题
如果输出a(2)就是下标越界了。LZ仔细检查下吧。
scscms太阳光 2010-04-07
  • 打赏
  • 举报
回复
split(jifen,"$")(1)<>"0"
=================比如:
a="1234"
split(a,"|")(0) '没有错
split(a,"|")(1) '就是下标越界,因为不存在|也就不能访问(1)

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧