• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 101
  • Last Modified:

Can I evaluate a variable in the value attribute of <cfhttpparam>?

Example:

<cfhttpparam type="header" name="code" value="#URL.code#">

Will this actually evaluate the code from the URL parameter?
0
Brian Coughter
Asked:
Brian Coughter
1 Solution
 
_agx_Commented:
Yep. There are a few exceptions, but for the most part, any CFML variable within a CF tag (cfquery, cfhttpparam, etc...) will be automatically evaluated.

You can see it in action, by creating two test pages. Run test.cfm and you'll see the value of the header "code" is "Some Value Here"

test.cfm
<cfset url.code = "Some Value Here">
<cfhttp url="http://yourserver.com/action.cfm">
	<cfhttpparam type="header" name="code" value="#URL.code#">
</cfhttp>
<cfoutput>#cfhttp.fileContent#</cfoutput>

Open in new window

action.cfm
<!--- display request data including headers --->
<cfdump var="#GetHttpRequestData()#">

Open in new window

1
 
Brian CoughterOwnerAuthor Commented:
Thank you
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now