| 发表于:2007-03-01 03:37:3712楼 得分:0 |
测试: 依照以下测试栏目分别建相应的目录,把这个源文件另存为test.asp, 分别copy到根,和相应目录下,点击链接测试. 实用时, 照此改写你的头部引用页. 但这仍要求您的所有栏目都应建立相应的目录,以便于检查. <% dim arrmenu(1) arrmenu(0) = array( "栏目一 ", "/channel/item/test.asp ") arrmenu(1) = array( "栏目二 ", "/item/test.asp ") dim currentpath currentpath = replacepath(request.servervariables( "path_info ")) with response .write (currentpath) .write ( " <table> <tr> ") for i = 0 to ubound(arrmenu) dim curpath curpath = replacepath(arrmenu(i)(1)) if instr(currentpath, curpath) = 1 then curmenucolor = "#d5d5d5 " else curmenucolor = "#ffffff " .write ( " <td bgcolor= " " " & curmenucolor & " " "> <a href= " " " & arrmenu(i)(1) & " " "> " & arrmenu(i)(0) & " : " & arrmenu(i)(1) & " </a> </td> " & vbcrlf) next .write ( " </tr> </table> " & vbcrlf) end with function replacepath(str) dim tmp tmp = str if tmp = " " then replacepath = "/ " : exit function tmp = left(tmp, instrrev(tmp, "/ ")) if right(tmp, 1) <> "/ " then tmp = tmp & "/ " replacepath = tmp end function %> | | |
|