MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference page 401

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions
<CFIF IsDefined("FORM.urladdress") is True>
<!--- do simple error check to avoid crashing the tag --->
<CFIF Trim(Form.urladdress) is "" or Trim(Form.urladdress) is "http:/
/">
<!--- if error condition tripped, set alternative --->
<CFELSE>
<!--- otherwise use address passed from form --->
</CFIF>
<!--- now use the CFHTTP tag to get the file content
represented by urladdress --->
<CFELSE>
<!--- the first time through, retrieve a URL that we know exists --->
<CFHTTP URL="http://localhost/cfdocs/index.htm"
METHOD="GET"
RESOLVEURL=YES>
</CFHTTP>
</CFIF>
<!--- Now, output the file, including the mimetype and content --->
<H3>Show the file</H3>
<CFOUTPUT>
<P>Here is an example of 255 characters from your file
output in HTMLCodeFormat:
<P>#HTMLCodeFormat(Mid(CFHTTP.FileContent,1,255))#
<P>Here is an example of 255 characters from your file
output in HTMLEditFormat:
<P>#HTMLEditFormat(Mid(CFHTTP.FileContent,1,255))#
</CFOUTPUT>
</BODY>
</HTML>
<CFSET urlAddress ="http://localhost/cfdocs/index.htm">
<H4>because you entered no url or an empty string, the tag
will return the following address:
http://localhost/cfdocs/index.htm</H4>
<CFSET urlAddress = "#FORM.urladdress#">
<CFHTTP URL="#urladdress#"
METHOD="GET"
RESOLVEURL=YES>
</CFHTTP>
377

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 4.5

Table of Contents