<!--- This example shows the use of HTMLCodeFormat
and HTMLEditFormat --->

<HTML>

<HEAD>
<TITLE>
HTMLCodeFormat Example
</TITLE>
</HEAD>

<BASEFONT FACE="Arial, Helvetica" SIZE=2>
<BODY  bgcolor="#FFFFD5">

<H3>HTMLCodeFormat Example</H3>

<P>This example has been disabled for online viewing.  Please use your copy of ColdFusion to view this example.
<!--- 
<FORM ACTION="htmlcodeformat.cfm" METHOD="POST">
Try entering a URL for the tag to return in HTMLCodeFormat
and HTMLEditFormat:
<INPUT TYPE="Text" size=25 NAME="urladdress" VALUE="http://www.allaire.com">


<INPUT TYPE="Submit" NAME="" VALUE="get page">
</FORM>

<!--- sets a default value for a url to retrieve --->
<CFPARAM name="urladdress" default="http://localhost/cfdocs/index.htm">

<!--- if we have passed a url address in the form, we
want to display the passed address --->
<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 --->
		<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>

	<CFELSE>
<!--- otherwise use address passed from form --->
		<CFSET urlAddress = "#form.urladdress#">
	</CFIF>
<!--- now use the CFHTTP tag to get the file content
represented by urladdress --->	
		<CFHTTP URL="#urladdress#"
			METHOD="GET"
			RESOLVEURL=YES>
		</CFHTTP>

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