|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP由于使用了COM组件所以它会变的十分强大,但是这样的强大由于WindowsNT系统最初的设计问题而会引发大量的安全问题。只要在这样的组件或是操作中一不注意,哪么外部攻击就可以取得相当高的权限而导致网站瘫痪或者数据丢失;三级下拉框连动
数据库:
location
表1loaction地点地表
字段
loactionid
loactionname名字
表2district地点的区域表
字段
locationid
districtid
districtname
表3village地点的县区表
字段
districtid
villageid
villagename
<%OptionExplicit%>
<html>
<head>
<title>List</title>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312">
<%
dimconn
dimrs
dimsql
dimcount
dimrs1
dimsql1
dimrs2
dimsql2
dimcount2
setconn=server.createobject("adodb.connection")
conn.open"provider=sqloledb;datasource=192.168.0.33;uid=sa;pwd=;database=location;"
sql="select*fromdistrictorderbylocationidasc"
setrs=conn.execute(sql)
%>
<scriptlanguage="JavaScript">
varonecount;
onecount=0;
subcat=newArray();
<%
count=0
dowhilenotrs.eof
%>
subcat[<%=count%>]=newArray("<%=trim(rs("districtname"))%>","<%=trim(rs("locationid"))%>","<%=trim(rs("districtid"))%>");
<%
count=count+1
rs.movenext
loop
rs.close
setrs=nothing
%>
onecount=<%=count%>;
functionchangelocation(locationid)
{
document.myform.smalllocation.length=0;
varlocationid=locationid;
vari;
document.myform.smalllocation.options[0]=newOption(==所选乡村的区域==,);
for(i=0;i<onecount;i++)
{
if(subcat[i][1]==locationid)
{
document.myform.smalllocation.options[document.myform.smalllocation.length]=newOption(subcat[i][0],subcat[i][2]);
}
}
}
</script>
<%sql2="select*fromvillageorderbydistrictidasc"
setrs2=conn.execute(sql2)
%>
<scriptlanguage="JavaScript">
varonecount2;
onecount2=0;
subcat2=newArray();
<%
count2=0
dowhilenotrs2.eof
%>
subcat2[<%=count2%>]=newArray("<%=trim(rs2("villagename"))%>","<%=trim(rs2("districtid"))%>","<%=trim(rs2("villageid"))%>");
<%
count2=count2+1
rs2.movenext
loop
rs2.close
setrs2=nothing
%>
onecount2=<%=count2%>;
functionchangelocation2(villageid)
{
document.myform.village.length=0;
varvillageid=villageid;
varj;
document.myform.village.options[0]=newOption(==所选区域的县区==,);
for(j=0;j<onecount2;j++)
{
if(subcat2[j][1]==villageid)
{
document.myform.village.options[document.myform.village.length]=newOption(subcat2[j][0],subcat2[j][2]);
}
}
}
</script>
</head>
<body>
<formname="myform"method="post">
标题:<inputtype="text"name="T2"size="20">
<inputtype="text"name="T3"size="20">
分类:<selectname="biglocation"size="1">
<optionselected>请选择你地点的省分</option>
<%
sql1="select*fromlocationorderbylocationnameasc"
setrs1=conn.Execute(sql1)
dowhilenotrs1.eof
%>
<optionvalue="<%=trim(rs1("locationid"))%>"><%=trim(rs1("locationname"))%></option>
<%
rs1.movenext
loop
rs1.close
setrs1=nothing
conn.Close
setconn=nothing
%>
</select><selectname="smalllocation">
<optionselectedvalue="">==一切区域==</option>
</select><selectname="village"size="1">
<optionselected>==一切县区==</option>
</select>
关头词:<inputtype="text"name="T4"size="20">
内容:<textarearows="9"name="S1"cols="51"></textarea>
</form>
</body>
</html>
缺点:正版成本价格贵(盗版就不说了)、不够安全,大多数服务器用windows系统,没有linux安全 |
|