日期:2014-05-17 浏览次数:20895 次
key=request.querystring("key") st="abcdefg" if instr(st,key)>0 then response.write "key包含在st中" end if
------解决方案--------------------
key=request.querystring("key") st="abcdefg" if len(key)=6 and instr(st,key)>0 then'增加判断长度 response.write "key长度为6并且key包含在st中" end if
------解决方案--------------------
1、
<% dim str,key,st st="asdfb" str=Request.ServerVariables("Query_String") if left(str,4)="key=" or instr(str,"&key=")>0 then key=split(str,"key=")(1) key=split(key,"&")(0) if len(key)=6 and instr(st,key)>0 then Response.write "key参数长度为6且在st字符串中" end if else Response.write "根本就没key参数" end if %>