Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String Manipulation Help

Status
Not open for further replies.

imstillatwork

IS-IT--Management
Joined
Sep 26, 2001
Messages
1,605
Location
US
I want to turn this:
OR

Into this:
index.cfm
OR
path/index.cfm

Length of path changes, sometimes more than one directory deep. All I want is the current path/filename.ext IF YOU DON'T KNOW HOW A TAG WORKS...
...DOWNLOAD THE CFML REFERENCE!
 
Hey imstillatwork,

This should do what you want as far as string manipulation goes.

<cfset mystring=&quot;<cfset newString=listrest(listrest(mystring,&quot;/&quot;),&quot;/&quot;)>

<cfoutput>#newString#</cfoutput>

You can also get the same thing just using #cgi.script_name# if you're just interested in the current script.

Hope this helps,
GJ
 
take a closer look at GetFileFromPath() and GetCurrentTemplatePath() functions; those should return the values you are looking for. Sylvano
dsylvano@hotmail.com
 
Ahhh... thanks I was looking for a function that sounded like it would do that, I must have skipped over it while looking through the book....
thanks both.

IF YOU DON'T KNOW HOW A TAG WORKS...
...DOWNLOAD THE CFML REFERENCE!
 
Actually there's a very easy way to do this. There is a CGI variable called SCRIPT_NAME which has exactly what you want. #CGI.SCRIPT_NAME# will return the path and filename, not including the hostname, starting at the web root of the webserver.


 
thanks, I found it. I am using SCRIPT_NAME. works well, does the job. kevin IF YOU DON'T KNOW HOW A TAG WORKS...
...DOWNLOAD THE CFML REFERENCE!
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top