• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 374
  • Last Modified:

asp variable for the filename of the asp file

I would like to know which asp variable I would use to get the name of the current asp file.

2 Solutions
Wayne BarronAuthor, Web DeveloperCommented:
Is this what you are referring too?

Dave BaldwinFixer of ProblemsCommented:
This short program will show you the values of all the available server variables.  Request.ServerVariables("PATH_INFO") is an example at the bottom but you can use any of the names shown in BOLD when you run the file on your ASP web server.

<%@ LANGUAGE = VBScript %>
<%  Option Explicit		%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"

<title>ASP Server Variables</title>
<h1>ASP Server Variables</h1>
Dim item

For each item in Request.ServerVariables
	Response.Write "<b>" & item & "</b>: " _
	& Request.ServerVariables(item) _
	& "<br>" & vbCrLf

	Response.Write "<b>PATH_INFO</b>: " _
	& Request.ServerVariables("PATH_INFO") _
	& "<br>" & vbCrLf



Open in new window

Scott Fell, EE MVEDeveloper & EE ModeratorCommented:
FullPageName= Request.ServerVariables("SCRIPT_NAME")
PageParser = instrRev(FullPageName,"/")
CurrentPage = mid(FullPageName, PageParser+1, len(FullPageName) - PageParser)
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now