ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 1st, 2012, 11:25 AM
chuck1rar chuck1rar is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 4 chuck1rar User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 24 sec
Reputation Power: 0
Passing variable into url

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>

Reply With Quote
  #2  
Old August 1st, 2012, 04:16 PM
cfSearching cfSearching is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2008
Posts: 117 cfSearching User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 h 16 m 2 sec
Reputation Power: 6
You need to clarify "doesn't work". What is the value you are testing and what happens when you run the code, an error ... ?

Reply With Quote
  #3  
Old August 1st, 2012, 07:41 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
The value in the URL is probably wrong? Try:

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

Reply With Quote
  #4  
Old October 1st, 2012, 03:27 PM
dsfx dsfx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 65 dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 18 h 38 m 2 sec
Reputation Power: 15
Quote:
Originally Posted by chuck1rar
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>


Your A tag needs to be inside the CFOUTPUT otherwise the #Str_Order# will be read as a string instead of a variable.

Code:
<cfset Str_Order =#rsorder.order_id#>
<cfoutput> #Str_Order# <p><a href="MyAccount.cfm?view=customsinvoice&OrderID=' #Str_Order# ' "> test</a></p></cfoutput>


That will give you the output you want.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Passing variable into url

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap