ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old August 26th, 2003, 03:37 AM
yhcmarc's Avatar
yhcmarc yhcmarc is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2001
Location: Heemskerk, The Netherlands
Posts: 254 yhcmarc User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 53 m 49 sec
Reputation Power: 8
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

Reply With Quote
  #2  
Old August 26th, 2003, 07:41 AM
roninblade's Avatar
roninblade roninblade is offline
// no comment
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Dec 2001
Posts: 1,639 roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 45 m
Reputation Power: 33
its Request.ServerVariables("APPL_PHYSICAL_PATH")

Reply With Quote
  #3  
Old August 26th, 2003, 07:49 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
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

Reply With Quote
  #4  
Old August 26th, 2003, 07:55 AM
roninblade's Avatar
roninblade roninblade is offline
// no comment
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Dec 2001
Posts: 1,639 roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level)roninblade User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 45 m
Reputation Power: 33
APPL_PHYSICAL_PATH is the counter part of the CGI Environment Variable DOCUMENT_ROOT.

Reply With Quote
  #5  
Old August 26th, 2003, 07:59 AM
Vlince Vlince is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Canada, Quebec, Montreal
Posts: 410 Vlince User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Ya I saw your post once I finished writing all of mine...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > get the document root ??


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway