|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
ColdFusion Teaser
I just thought that I would show how to get form variables when a form is submitted in ColdFusion.
Here is a very simple form and the outputing of the form fields. <html> <head> <title>CF Teaser</title> </head> <cfparam name="form.fname" default=""> <cfparam name="form.lname" default=""> <body> <form action="<cfoutput>#cgi.script_name#</cfoutput>" method="post"> First Name:<input type="text" name="fname" size="25" maxlength="30"><br> Last Name:<input type="text" name="lname" size="25" maxlength="30"><br> <input type="submit" name="go" value=" Say Hello "> </form> <cfif isDefined('form.go')> Hello <cfoutput>#form.fname# #form.lname#</cfoutput>! </cfif> </body> </html> You can copy and paste this code into a coldfusion page and not have to change any of the code for it to work. If you want to talk about this code, just ask me ![]()
__________________
Clint Tredway Need a website? Need development help? www.fishermenstudios.com ctredway@fishermenstudios.com |
|
#2
|
|||
|
|||
|
I forgot one tiny detail that some people may not know...
If you use the code that I showed in the previous post, you must save the file with a .cfm extention. If you do not, the ColdFusion will not render it and therefore it will bu useless. HTH, |
|
#3
|
|||
|
|||
|
Clint, is there a way in coldfusion to change the extensions. so it parse say cfm, html html etc...??
|
|
#4
|
|||
|
|||
|
That depends on the web server you are using. I know how to change IIS to make ColdFusion parse any extention that you want, but I do not know about Apache as I have limited experience with Apache.
|
|
#5
|
|||
|
|||
|
Just as easy in Apache, it is a function of the web server, not of Cold Fusion per se, the web server has a 'map' of extensions and what it should do with them (send them straight to the client, call a program to handle them, ignore them etc.). Using .cfm for cold fusion, .php for php, .htm for html etc. is just convention, not necessity.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Cold Fusion Development > ColdFusion Teaser |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|