• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Passing variable into url

New Here ,
Aug 01, 2012 Aug 01, 2012

Copy link to clipboard

Copied

Am sure am missing something but why doesnt this work???

If I hardcode the string value it works fine...

<cfset Str_Order =#rsorder.order_id#>

<cfoutput> #Str_Order# </cfoutput>

<p><a href="MyAccount.cfm?view=customsinvoice&OrderID=' #Str_Order# ' "> test</a></p>

Views

700

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 01, 2012 Aug 01, 2012

Copy link to clipboard

Copied

Try This

------

<cfoutput>

<p><a href="MyAccount.cfm?view=customsinvoice&OrderID=#Str_Order#"> test</a></p>

</cfoutput>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Aug 01, 2012 Aug 01, 2012

Copy link to clipboard

Copied

Lose the single quotes.

Saurav's idea should work as well.

In either case, you should also encode for url.

<cfoutput>

<p><a href="MyAccount.cfm?view=customsinvoice&OrderID=#URLEncodedFormat(Str_Order)#"> test</a></p>

</cfoutput>

jason

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 01, 2012 Aug 01, 2012

Copy link to clipboard

Copied

LATEST

If this is your actual code:

<a href="MyAccount.cfm?view=customsinvoice&OrderID=' #Str_Order# ' ">

You don't need the single quotes and you don't want the spaces.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation