Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 105969
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:31:22+00:00 2026-05-11T01:31:22+00:00

I was just reviewing some old code and found the following (inside foo.asp): Const

  • 0

I was just reviewing some old code and found the following (inside foo.asp):

Const ASP_FILENAME = 'foo.asp'  ' TODO: Update this to the name of this file (if changed) 

The variable is only used for logging errors. (ie. ‘Error in foo.asp – Could not create xxxxx object.’) Is there any way to avoid this?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:31:23+00:00Added an answer on May 11, 2026 at 1:31 am

    From the now-defunct Aspfaq.com (thanks to Archive.org):

    How do I get the name of the current URL / page?

    This one is pretty easy, but there are two parts.

    To retrieve the name of the current file, you can use any of these:

    <%      Response.Write Request.ServerVariables('SCRIPT_NAME') & '<br>'      Response.Write Request.ServerVariables('PATH_INFO') & '<br>'      Response.Write Request.ServerVariables('URL') & '<br>'  %> 

    To make that path local (for example, to use with FileSystemObject), just apply the server.mappath() method to the result.

    To get the entire URL, including the http:// or https:// prefix, you can do this:

    <%      prot = 'http'      https = lcase(request.ServerVariables('HTTPS'))      if https <> 'off' then prot = 'https'      domainname = Request.ServerVariables('SERVER_NAME')      filename = Request.ServerVariables('SCRIPT_NAME')      querystring = Request.ServerVariables('QUERY_STRING')      response.write prot & '://' & domainname & filename & '?' & querystring  %> 

    To get the page name ONLY, use something like this:

    <%      scr = Request.ServerVariables('SCRIPT_NAME') & '<br>'      if instr(scr,'/')>0 then          scr = right(scr, len(scr) - instrRev(scr,'/'))      end if      response.write scr  %> 

    Or, without the IF logic:

    <%      scr = Request.ServerVariables('SCRIPT_NAME') & '<br>'      loc = instrRev(scr,'/')      scr = mid(scr, loc+1, len(scr) - loc)      response.write scr  %> 

    Now. If your file is an #INCLUDE within another file, the above scripts will produce the name of the CALLING file (since the included file is first integrated into the calling script, then the ASP within it is all executed in the context of the ‘parent’ file). One way you can work around this is to re-populate a current_filename variable before loading each include file, for example:

    <%        current_filename = 'filetoinclude.asp'   %>   <!--#include file='filetoinclude.asp'--> 

    (And no, don’t try passing current_filename as a variable to the #INCLUDE directive; see Article #2042.)

    Then, in filetoinclude.asp:

    <%      Response.Write 'Current file: ' & current_filename  %> 

    Of course, you could just as easily hard-code the filename inside of each include file. But I suppose that solution would somewhat defeat the purpose of retrieving that information at least somewhat dynamically.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 142k
  • Answers 142k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer There is this codehaus page with some guidelines. I found… May 12, 2026 at 8:15 am
  • Editorial Team
    Editorial Team added an answer It's probably a relic from an early implementation of the… May 12, 2026 at 8:15 am
  • Editorial Team
    Editorial Team added an answer GridViewColumn's Width property is of type double, but according to… May 12, 2026 at 8:15 am

Related Questions

What I mean by this, is that sometimes architects look to simplify and improve
I'm interested in putting together my first online game using Flash as the client
Okay, so here's my problem: We use FOP for creating pretty report output. We
Short of rolling your own. There has to be something out there. FlexLM/FlexNet is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.