|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
self varible
Its the coldfusion noob again here..techmike 05/26/04 10:25 A Take at all of the CGI variables. Some really good and useful stuff there.Greg Landers 05/26/04 10:31 A Do you mean the current file name? If so, you can useRaymond Camden 05/26/04 10:31 A >> Is there a self varible in coldfusion? much like $PHP_SELF if yourd.a.collie 05/26/04 10:28 A also you may want to tryTony Weeg 05/26/04 10:33 A #GetFileFromPath(GetCurrentTemplatePath())#Pascal Peters 05/26/04 10:29 A Exactally what I needed..techmike 05/26/04 11:17 A there isTony Weeg 05/26/04 11:21 A As far as I've seen just leaving the Action blank will always self-submit -Jim Davis 05/26/04 01:21 P <form action="#CGI.SCRIPT_NAME#">Pascal Peters 05/26/04 11:20 A > <form action="#GetFileFromPath(GetCurrentTemplatePath())#"Alistair Davidson 05/26/04 12:10 P Is this actually the best way to post a form to itself? What I'm runningtechmike 05/26/04 12:33 P not sure what you mean?Tony Weeg 05/26/04 12:37 P <bangs head off desk>techmike 05/26/04 12:42 P Its the coldfusion noob again here.. Is there a self varible in coldfusion? much like $PHP_SELF if your familier with that.. So, if the varible were used in blah.cfm, the content of it would be just blah.cfm. -Mike Take at all of the CGI variables. Some really good and useful stuff there. I use #cgi.SCRIPT_NAME# frequently. Sounds like this would output what you are wanting. Greg Its the coldfusion noob again here.. Is there a self varible in coldfusion? much like $PHP_SELF if your familier with that.. So, if the varible were used in blah.cfm, the content of it would be just blah.cfm. -Mike Do you mean the current file name? If so, you can use getCurrentTemplatePath(), which returns the full path, and if you want just the file, use getFileFromPath... <cfoutput> #getFileFromPath(getCurrentTemplatePath())# </cfoutput> >> Is there a self varible in coldfusion? much like $PHP_SELF if your functions... getBaseTemplatePath() getTemplatePath() -- dc also you may want to try <cfdump var="#cgi#"> just to see what other variables are out there. and while your at it... <cfdump var="#session#"> <cfdump var="#server#"> <cfdump var="#application#"> <cfdump var="#form#"> <cfdump var="#url#"> <cfdump var="#client#"> just to see what else is there and available. I have those all cfdumped in my onRequestEnd.cfm file if the website visitor is my ip address, for most of my sites, so I can always see what vars are there and working. tw >> Is there a self varible in coldfusion? much like $PHP_SELF if your functions... getBaseTemplatePath() getTemplatePath() -- dc #GetFileFromPath(GetCurrentTemplatePath())# ----- Excess quoted text cut - see Original Post for more ----- Exactally what I needed.. Thanks for the quick replies.. Was trying to figure out how to post a form to itself.. <form action="#GetFileFromPath(GetCurrentTemplatePath())#" method="post"> Seems to work, but is there a better or more correct way? -Mike ----- Excess quoted text cut - see Original Post for more ----- there is <form action="#cgi.script_name#" method="post"> </form> look @ my last reply. there are myriad things to output, if you know what to output and what you cant see, may be visible through those cfdumps. tw Exactally what I needed.. Thanks for the quick replies.. Was trying to figure out how to post a form to itself.. <form action="#GetFileFromPath(GetCurrentTemplatePath())#" method="post"> Seems to work, but is there a better or more correct way? -Mike ----- Excess quoted text cut - see Original Post for more ----- As far as I've seen just leaving the Action blank will always self-submit - correct? Jim Davis Exactally what I needed.. Thanks for the quick replies.. Was trying to figure out how to post a form to itself.. <form action="#GetFileFromPath(GetCurrentTemplatePath())#" method="post"> Seems to work, but is there a better or more correct way? <form action="#CGI.SCRIPT_NAME#"> The code below will not work inside a cfinclude, Custom tag, ... ----- Excess quoted text cut - see Original Post for more ----- > <form action="#GetFileFromPath(GetCurrentTemplatePath())#" method="post"> > Seems to work, but is there a better or more correct way? Yes That will only work if your file is in the root directory of your website. Try this instead - <form action="#CGI.SCRIPT_NAME#" method="post"> Cheers, Alistair Davidson Senior Technical Developer Headshift.com Smarter, Simpler, Social Is this actually the best way to post a form to itself? What I'm running into now is it works, however it appends to the end of the url whatever the action is. Example. blah.com/test.cfm#CGI.SCRIPT_NAME# -mike ----- Excess quoted text cut - see Original Post for more ----- not sure what you mean? is the page not parsing #cgi.script_name# ? do you have <cfoutput></cfoutput> around it somewhere? tw Is this actually the best way to post a form to itself? What I'm running into now is it works, however it appends to the end of the url whatever the action is. Example. blah.com/test.cfm#CGI.SCRIPT_NAME# -mike ----- Excess quoted text cut - see Original Post for more ----- <bangs head off desk> What a stupid oversight on my part.. Thanks! -Mike ----- Excess quoted text cut - see Original Post for more -----
|
February 09, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||