Reliability of Path_INFO server variable in classic ASP

半城伤御伤魂 提交于 2019-12-24 14:58:51

问题


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:


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



来源:https://stackoverflow.com/questions/3508206/reliability-of-path-info-server-variable-in-classic-asp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!