House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

self varible

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
techmike
05/26/2004 10:25 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Greg Landers
05/26/2004 10:31 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
05/26/2004 10:31 AM

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>

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
d.a.collie
05/26/2004 10:28 AM

>> Is there a self varible in coldfusion?  much like $PHP_SELF if your functions... getBaseTemplatePath() getTemplatePath() -- dc

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/26/2004 10:33 AM

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

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/26/2004 10:29 AM

#GetFileFromPath(GetCurrentTemplatePath())# ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
techmike
05/26/2004 11:17 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/26/2004 11:21 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Jim Davis
05/26/2004 01:21 PM

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?

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pascal Peters
05/26/2004 11:20 AM

<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 -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alistair Davidson
05/26/2004 12:10 PM

> <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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
techmike
05/26/2004 12:33 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tony Weeg
05/26/2004 12:37 PM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
techmike
05/26/2004 12:42 PM

<bangs head off desk> What a stupid oversight on my part..  Thanks! -Mike ----- Excess quoted text cut - see Original Post for more -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 09, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29