Function to Find File Name of Page Displayed

/ Published in: ASP
Save to your folder(s)

Copy this code and paste it in your HTML
  1. Function getFileName()
  2. Dim lsPath, arPath
  3. 'Obtain the virtual file path
  4. lsPath = Request.ServerVariables("SCRIPT_NAME")
  5. 'Split the path along the /s. This creates a one-dimensional array
  6. arPath = Split(lsPath, "/")
  7. 'The last item in the array contains the file name
  8. getFileName = arPath(UBound(arPath,1))
  9. End Function

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.