asp判断长字符串是否包含有某个短字符串

来源:百度知道 编辑:UC知道 时间:2024/05/11 16:12:40
<%
dim url,aa,a,b url=Request.ServerVariables("HTTP_HOST")&request.servervariables("http_url")
a="product.asp"
b="changshinews.asp"
if instr(url,a)>0 then aa=1 end if
if instr(url,b)>0 then aa=2 end if
%>
假如我的网站是http://genius:82/product.asp的话那aa的值就正常的显示是1,如果网址改成假如是:http://genius:82/Product.asp?BigClassName=&SmallClassName=&page=3的时候aa就获取不到值了呢?

我试了一下,在我的电脑上可以显示:
<%
url=Request.ServerVariables("HTTP_HOST")&request.ServerVariables("URL")
a="b.asp"
b="changshinews.asp"
if instr(url,a)>0 then aa=1 end if
if instr(url,b)>0 then aa=2 end if
response.Write(aa)
response.Write("<br>")
response.Write(request.QueryString("a"))
response.Write("<br>")
response.Write(request.QueryString("b"))
%>

http://localhost/b.asp
显示:
1

http://localhost/b.asp?a=5
显示:
1
5

http://localhost/b.asp?a=5&b=5
显示:
1
5
5