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 January 10th, 2012, 05:24 PM
korssane korssane is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2011
Posts: 60 korssane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 3
URL encodedFormat

Hi Peers,

i'am trying to pass a URL "encodedFormat" string to another page.
I'am having trouble to pass symbols like # otherwise everything else seem to work.

source page

Code:
<cfset var1="abc$d"> 
<cflocation url="URLDECODE.cfm?var11=#urlEncodedFormat(var1)#">



destination page

Code:
<cfoutput> 
The url variable passed is : #URL.var11# </cfoutput>


if i put var1="abc12#", this will gimme an error ...

problem happens only with # symbol

Thoughts

Last edited by korssane : January 10th, 2012 at 05:47 PM.

Reply With Quote
  #2  
Old January 10th, 2012, 08:56 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 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 4 h 29 m 54 sec
Reputation Power: 966
<cfset var1="abc$d">
<cfset encodedVar1 = URLEncodedFormat( var1 ) />
<cflocation url="URLDECODE.cfm var11=#encodedVar1#">

Reply With Quote
  #3  
Old January 11th, 2012, 12:07 PM
korssane korssane is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2011
Posts: 60 korssane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 3
Quote:
Originally Posted by kiteless
<cfset var1="abc$d">
<cfset encodedVar1 = URLEncodedFormat( var1 ) />
<cflocation url="URLDECODE.cfm var11=#encodedVar1#">



Hi Kiteless,
this does not work for me. iam trying to pass "abc$d#" ..it seems not accepting the # sign..

error :

Invalid CFML construct found on line 20 at column 18.

ColdFusion was looking at the following text:
URLDECODE.cfm

The CFML compiler was processing:

An expression that began on line 18, column 19.
The expression might be missing an ending #, for example, #expr instead of #expr#.
An expression beginning with \", on line 18, column 13.This message is usually caused by a problem in the expressions structure.
A cfset tag beginning on line 18, column 2.

The error occurred in C:\ColdFusion9\wwwroot\URLENCODE.cfm: line 20
18 : <cfset var1="abc$d#">
19 : <cfset encodedVar1 = URLEncodedFormat( var1 ) />
20 : <cflocation url="URLDECODE.cfm var11=#encodedVar1#">
21 :
22 :

Reply With Quote
  #4  
Old January 11th, 2012, 04:38 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 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 4 h 29 m 54 sec
Reputation Power: 966
Try escaping the pound sign:

<cfset var1="abc$d##">

Reply With Quote
  #5  
Old January 12th, 2012, 10:23 AM
korssane korssane is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2011
Posts: 60 korssane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 3
Quote:
Originally Posted by kiteless
Try escaping the pound sign:

<cfset var1="abc$d##">


Hi Kiteless, i got that but how if i have a text field value that contains # pound sign and want to pass in URL ?


thanks

Reply With Quote
  #6  
Old January 12th, 2012, 06:53 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 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 4 h 29 m 54 sec
Reputation Power: 966
It should work fine, I'm pretty sure you only have to escape pound signs you declare in CF code.

Reply With Quote
  #7  
Old January 13th, 2012, 07:21 AM
korssane korssane is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2011
Posts: 60 korssane User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 13 h 22 m 2 sec
Reputation Power: 3
Quote:
Originally Posted by kiteless
It should work fine, I'm pretty sure you only have to escape pound signs you declare in CF code.


hi kiteless,
it is not clear. i'am assuming that the user might enter a pound sign in a text field and then i try to pass it ..
thanks

Reply With Quote
  #8  
Old January 13th, 2012, 08:22 AM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,100 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 4 h 29 m 54 sec
Reputation Power: 966
If you declare a pound sign in CFML code, you must escape it because the pound sign has special meaning in CFML code. If the value is passed in from outside the code, you don't have to escape it.

Just build a simple form, open it in your browser, and test it.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > URL encodedFormat

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