
1237
DEVELOPING
COLDFUSION 9 APPLICATIONS
Using External Resources
Las
t
upda
te
d 8/5/2010
<cfhttp method="Get"
url="http://127.0.0.1/myapps/text.txt"
name="juneorders"
textqualifier="">
<cfoutput query="juneorders">
OrderID: #OrderID#<br>
Order Number: #OrderNum#<br>
Order Date: #OrderDate#<br>
</cfoutput>
<!--- Now substitute different column names --->
<!--- by using the columns attribute --->
<hr>
Now using replacement column names<br>
<cfhttp method="Get"
url="http://127.0.0.1/myapps/text.txt"
name="juneorders"
columns="ID,Number,ODate,SDate,Name,Address"
textqualifier="">
<cfoutput query="juneorders">
Order ID: #ID#<br>
Order Number: #Number#<br>
Order Date: #SDate#<br>
</cfoutput>
4
Save the file as query_textfile.cfm in the myapps directory under your
web_root
and view it in the web browser.
Using the cfhttp Post method
Use the Post method to send cookie, form field, CGI, URL, and file variables to a specified ColdFusion page or CGI
program for processing. For Post operations, use the cfhttpparam tag for each variable you want to post. The Post method
passes data to a specified ColdFusion page or an executable that interprets the variables being sent and returns data.
For example, when you build an HTML form using the Post method, you specify the name of the page to which form
data is passed. You use the Post method in cfhttp in a similar way. However, with the
cfhttp
tag, the page that receives
the Post does not, itself, display anything.
Pass variables to a ColdFusion page
1
Create a ColdFusion page with the following content:
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...