does any1 know how to grab the file name. For example : I have a db with 2 columns : First Column is names of files, second column is a string. So i want to output that string where the filename of the db is equal to the filename of the cfm file i am working with... any help would be appreciated
There might be a better way but this will work: <cfset filename = replace(cgi.SCRIPT_NAME,"/","") /> <cfdump var="#filename#">
so that would set the variable filename to whatever the file name is.. So if the file name is xyz.cfm, the variable filename is equal to xyz.cfm?? Makes sense, ill give it a try and let you know... Thanks, appreciate it!
the problem with that is that it gives me the whole file path ie xy/asd.cfm ... i just the name of the file, any suggestions?
This will work for both linux and windows: <cfset filename = listlast(cgi.SCRIPT_NAME,'/\') /> <cfdump var="#filename#"> You need the slashes both ways ie windows c:\wwwroot\sitea and linix /var/www/virtual/sitea