www.webdeveloper.com
Results 1 to 3 of 3

Thread: Where am I on the local server?

  1. #1
    Join Date
    Nov 2002
    Posts
    411

    Where am I on the local server?

    Is there some script I can run that will tell me where on the local server my scripts are located?

    I'm running on a local intranet, and to get to a database I've uploaded I think I need to give my script the local address, eg. c:\windows\wwwroot\intranet or some such.

    Any ideas? Many thanks in advance,

    John

  2. #2
    Join Date
    Jul 2004
    Location
    Singapore, SG
    Posts
    654
    The following will show the script's location.
    Code:
    Server.mapPath(Request.ServerVariables("SCRIPT_NAME"))

  3. #3
    Join Date
    Feb 2003
    Posts
    2,745
    Also, if you know the relative path, then you can access it with Server.MapPath(relative_path_here)

    For example:

    strPath = Server.MapPath("/mystuff/data/file.ext")

    strPath Would now be something like this (depending on the actual location on your server) "c:\inetpub\wwwroot\mystuff\data\file.ext".

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles