• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • 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.

Thanks
0
HalCHub
Asked:
HalCHub
2 Solutions
 
Wayne BarronCommented:
Is this what you are referring too?
http://www.plus2net.com/asp-tutorial/file-name.php

Carrzkiss
0
 
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"
 "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<title>ASP Server Variables</title>
</head>
<body>
<h1>ASP Server Variables</h1>
<%
Dim item

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

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

%>

</body>
</html>

Open in new window

0
 
Scott Fell, EE MVEDeveloperCommented:
<%
FullPageName= Request.ServerVariables("SCRIPT_NAME")
PageParser = instrRev(FullPageName,"/")
CurrentPage = mid(FullPageName, PageParser+1, len(FullPageName) - PageParser)
%>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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