Reliability of Path_INFO server variable in classi

2019-07-31 23:24发布

Am I always going to be able to use PATH_INFO to derive the root of my application as in the following function?

function CommonFunctions_getRoot()


    pathinfo=Request.ServerVariables("PATH_INFO")

    Set myRegExp = New RegExp
    myRegExp.IgnoreCase = True
    myRegExp.Global = True
    myRegExp.Pattern = "^(/\w*/).*" 
    CommonFunctions_getRoot = myRegExp.Replace (pathinfo, "$1")


end function

1条回答
可以哭但决不认输i
2楼-- · 2019-08-01 00:02

PATH_INFO is reliable. The only problem I can think of is that you may have issues if you use URL rewriting.

查看更多
登录 后发表回答