作者:天极Yesk…
来源:天极Yesky
热度:
2007-6-5 12:40:44
源代码
第二件要作的事情是:从URL头信息里分离出查询部分--这个才是我们需要的。
| 以下是引用片段: '从指向URL中分离查询字段。 Function isProduct(pStr) If pStr <> "" And lCase(pStr) <> "none" Then '向后搜索字段 temp = inStrRev(pStr, "/") '得到目录分离的位置 tempStr = Right(pStr, temp) '得到有关数据长度 temp2 = Len(pStr) '得到查询数据行 pStr = Mid(pStr, temp, temp2) '设定返回功能的值 isProduct = pStr Else isProduct = "" End If End Function |
接着是要确立查找的明确标准。为达到这个目的,建立两个静态空间"指?查找指向数据
| 以下是引用片段: Function Finder(byRef prodList, byVal refList) '模糊查询 refList = lCase(refList) ' 通过指针循环查找匹配字段 For i = 0 To uBound(prodList) - 1 If inStr(refList, lCase(prodList(i, 0))) Then '找到匹配 tHolder = tHolder & "Are You looking For " _ & "" _ & prodList(i, 0) & " " End If '第二次循环 Next '返回结果 Finder = tHolderEnd Function |
通过一个inclue,把我们做好的decode.ASP放到需要此功能的任何页面,大功告成啦。
具体如下:
| 以下是引用片段: '如果指向头不为空,调出此功能If lCase(Session("Referer")) <> "none" OR Session ("Referer") <> "" Then' 解析指向数据 Response.Write vbCrLf & " " _ & Finder(pArray, URLDecode(isProduct(Session("Referer")))) _ & " " & vbCrLf End If |
我来说两句:
推荐文章
相关文章