This content has been marked as final. Show 7 replies
It's probably just a typo but the closing # needs to be on the other side of the bracket.
You use URLDecode the same way
<cfset myvar = URLDecode(url.var)>
yeah, I forgot the #. Thanks for the info. Going to try it now!
If you access the variable, as a normal CF variable:
You do not need to do anything, because CF will perform necessary conversion for you.
Now if I were to attempt to pass 3 variables across a URL, would I have to
encode each of them separately?
While you more than likely can do this in one urlencode function, I'm a bit wierd and like to see exactly what's happening in the code by looking at it. So I would do them seperately.
This is why I would also use urldecode, just makes it obvious what's happening.
That's cool. I think I would rather do it individually.
What is the best (person preferences) charset format for encoding?
1. You need to use URLEncodedFormat() for every value you pass, not for the entire query string.
2. You cannot arbitrary apply URLDecode() in your application, if you receive values, as Cold Fusion variables.
Consider the following example:
<a href="test.cfm?mvar=<cfoutput>#URLEncodedFormat(mvar)#<cfoutput>">Click Me</a>
Then, on test.cfm page:
You will see that values are different and the second one is not that you passed....