I am trying to cfinclude a file and also pass some values to that specific file. I don’t know if it is possible so any reply is appreciated.
This is my code:
<cfoutput>
<cfset path = "?id=#email_id#&contactid=#email_contactid#&ownerid=#email_ownerid#">
<cfinclude template="/email_results#path#">
</cfoutput>
My mapping goes something like this:
E:\sites\exampleCom\cf_modules\reports\resultsTemplate.cfm
I did a #expandPath(“/email_results#path#”)# and it is giving me the correct output
(E:\sites\exampleCom\cf_modules\reports\resultsTemplate.cfm?id=123&contactid=123&ownerid=123)
but when I am trying to include the file it bugs out. Can I pass in variables through the cfinclude? Is this what it bugs out my code?
No, you do not pass variables to an include page. The include will be execute in the same context, so it can directly see the
email_idand other variables.