Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with APPL_PHYSICAL_PATH server variable? 1

Status
Not open for further replies.

dflanagan

MIS
Oct 5, 2001
115
US
HI,
I am trying to use the server variable APPL_PHYSICAL_PATH to tell my code what directory path the user is executing the current page from. The problem is, it keeps returning:

c:\inetpub\
But it should be returning one more folder deep. ie:

c:\inetpub\
for this example, I am saying that the asp page is located in "c:\inetpub\ Why is this server variable returning the wrong path?

Thanks!
 
Try This.
<%=Server.MapPath(Request.ServerVariables(&quot;SCRIPT_NAME&quot;))%>
 
Thanks!

I just figured something very similar out using server.mapPath. I wonder what is wrong with the other command... Anyway, thanks for the help! You are the best!
 
That will tell your where the application is, not the current page. :)

-Bad Dos
 
right... in my example above, let say I had an asp page with that variable located in:
c:\inetpub\
Shouldn't that variable return:
c:\inetpub\
mine only returns:
c:\inetpub\Yet, the example I got for the server variables from this page:

Shows that variable returning a more direct path. Maybe there is a setting in the IIS admin that needs to be set as the root of this &quot;application&quot;. Doesn't really matter, I can get what I need with the other example. I just like to understand why.
 
No... The asp application path is the root of your website or virtual folder. It was returning the correct response.
 
Ahh! I understand. That is what I was not clear on. WHAT it was actually looking at. Thanks again for the help!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top