Skip to main content
Participating Frequently
June 7, 2006
Question

To recognise the path of your page.

  • June 7, 2006
  • 2 replies
  • 407 views
I need to keep only the file of my page.
I don't need to keep also the domain name.

ex. www.site.com/filename.cfm

How I can do to insert into the variable "pagename" only: filename.cfm
<cfset pagename = ....>


Thanks

CFwork
    This topic has been closed for replies.

    2 replies

    Inspiring
    June 7, 2006
    You can do the same thing with:
    <CFSET pagename = ListLast(CGI.SCRIPT_NAME, "/")>

    There are a few ways to implement what you need actually.

    Fernis
    Inspiring
    June 8, 2006
    Or <cfset pagename = getFileFromPath(SCRIPT_NAME)>
    June 7, 2006
    <CFSET pagename = ListLast(CGI.CF_TEMPLATE_PATH, "\")>