Adobe COLDFUSION 9 Manual page 985

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
<!--- Verify whether the text entered by the user matches the CAPTCHA string. --->
<cfif #form.hashval# eq Hash(#form.userInput#)>
<cfoutput>
<p>
Thank you for registering for our online newsletter, #form.firstName# #form.lastName#.
</p>
<p>
A notification has been sent to your e-mail address: #form.mailTo#.
</p>
<cfmail from="newsletter@domain.com" to="#form.mailTo#" subject="Newsletter">
Thank you for your interest in our Newsletter.
</cfmail>
</cfoutput>
<cfelse>
<p>I'm sorry; please try again.</p>
</cfif>
Creating versions of an image
The following example shows how to create an application that lets you generate four versions of the same image,
display the versions in a form, and choose which one to save. The application comprises three ColdFusion pages that
perform the following tasks:
• Dynamically populate a drop-down list box from a database query.
• Use the
tag to create a ColdFusion image from the title selected from the list. Use the
cfimage
to create three clones of the ColdFusion image. Use the
each clone.
• Save the file chosen from the form to a new location.
Example
On the first form page, create a query that selects the artwork from the
in a pop-up menu:
<!--- Create a query to extract artwork from the cfartgallery database. --->
<cfquery name="artwork" datasource="cfartgallery">
SELECT ARTID, ARTNAME, LARGEIMAGE
FROM ART
ORDER BY ARTNAME
</cfquery>
<!--- Create a form that lists the artwork titles generated by the query. Set the value to
LARGEIMAGE so that the image file is passed to the action page. --->
<cfform action="dupImage2.cfm" method="post">
<p>Please choose a title:</p>
<cfselect name="art" query="artwork" display="ARTNAME" value="LARGEIMAGE" required="yes"
multiple="no" size="8">
</cfselect>
<br/><cfinput type="submit" name="submit" value="OK">
</cfform>
On the first action page, clone the original image three times, change the sharpness setting for each clone, and display
the results:
ImageSharpen
cfartgallery
Last updated 8/5/2010
ImageNew
function to change the sharpness setting for
database and displays the titles
980
function

Advertisement

Table of Contents
loading

Table of Contents