|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
get the document root ??
Does anyone know how to get the document root in asp, just like the php command
$_SERVER['DOCUMENT_ROOT'] I cannot find anything like this in the Request.ServerVariables so I tried something, and it just doesn't work. I'm pretty new to asp as I am a php programmer and just have to do some asp projects for my work ... Code:
<%
Dim scriptPath, fullPath, docRoot
scriptPath = Request.ServerVariables("PATH_INFO")
fullPath = Request.ServerVariables("PATH_TRANSLATED")
docRoot = Replace( fullPath, scriptPath, "")
Response.Write docRoot
%>
Thanx in advance. Marc |
|
#2
|
||||
|
||||
|
its Request.ServerVariables("APPL_PHYSICAL_PATH")
|
|
#3
|
|||
|
|||
|
What do you mean by the root document?
Now, maybe you already know all of this and if you do then don't get offended for me writting it ![]() Because *usually* when you instal IIS(and leave everything to default), it creates a C:\Inetpub folder Then inside that folder it has another folder called wwwroot This is the place where you put your web sites/applications So for example, I can have 3 different folders inside the wwwroot folder...something like: C:\Inetpub\wwwroot\WebSite1 C:\Inetpub\wwwroot\WebSite2 C:\Inetpub\wwwroot\WebSite3 Then inside WebSite1 for example, I put all my .asp files. Now, do you need/want to access the root document of the WebSite1 folder? ***OR*** Do you need to access the root document of the wwwroot folder? Either way, try using the: Response.Write Server.MapPath(".") and see what it gives you! Hope this helps! Sincerely Vlince |
|
#4
|
||||
|
||||
|
APPL_PHYSICAL_PATH is the counter part of the CGI Environment Variable DOCUMENT_ROOT.
|
|
#5
|
|||
|
|||
|
Ya I saw your post once I finished writing all of mine...
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > get the document root ?? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|