Posting Form Values With The ColdFusion CFHttp And CFHttpParam Tags

<!--- Determine the URL to post to. --->
<cfset strUrl = (
	"http://" &
	CGI.http_host &
	GetDirectoryFromPath( CGI.script_name ) &
	"post.cfm"
	) />
 
 
<!--- POST data to url using CFHttp. --->
<cfhttp
	url="#strUrl#"
	method="POST"
	result="objHttp">
 
	<cfhttpparam
		type="FORMFIELD"
		name="last_name"
		value="nadel"
		/>
 
	<cfhttpparam
		type="FORMFIELD"
		name="first_name"
		value="ben"
		/>
 
</cfhttp>
 
<!--- Output reponse string. --->
<cfset WriteOutput(
	objHttp.FileContent
	) />

For Cut-and-Paste