Atitit. Get AppRoot API Apply Root Path java c#.net php asp
1.returns /appIf the root path returns empty,compatible with Getcontextpath()
<script type= "Text/javascript" src= ". /com.attilax/core/approot_js.jsp "></script>
<%@ page contenttype= "text/html; Charset=utf-8 "language=" java "import=" java.sql.* "%>
<%
String path = Request.getcontextpath ();
%>
$app _path= "<%=path%>";
App_path= "<%=path%>";
$envi = "Java";
Apiurl= "<%=aaacfg.iocx4jobui.getcfgval (" Hre_web_url ")%>";
$iocx _iner= "Nonex";
$iocx = "Nonex";
author:: Nickname:Old Wow's claws( Full Name::AttilaxAkbar Al Rapanui Attilaksachanui) Kanji Name:Ayron, email:[email protected]
Reprint please indicate source: http://www.cnblogs.com/attilax/
2.but for PHP is a scripting language, there is no approot concept,
PHP generally need to define the root directory of the site, the following is a common code, you need a friend to refer to the next.
Copy Code The code is as follows:
Define (' Base_path ', str_replace (' \ \ ', '/', Realpath (dirname). ' /.. /‘)));
This is to be manually specified in a bad way.
The best practice is to put a __approot file, indicating the path to the application. More dynamic.
3.ASP
Request.applicationpath; ///aspnet
Method 3,request.applicationpath;// get The virtual application root directory of the ASP.
4.Reference
ASP. NET gets the root directory of methods collection _ I love learning Web . htm
Trace Net , trace Net blog , Trace net Studio -henw.htm
ASP. NET Get site root summary details -- Source House (mycodes.net). htm
Atitit. Get approot api app Root path java c#.net php asp