Skip to main content
lovewebdev
Inspiring
January 11, 2010
Answered

URL encode everything in a url but the = signs

  • January 11, 2010
  • 1 reply
  • 678 views

I jave one long string with pairs of parameter and values concatenated like so:

<cfset mystring = "variable1=$13&variable2=http://&variable3=z">

I need to url encode the parameter and parameter values... but the = equal sign should not be encoded.

Do I have to split the the string up.

I also can't have the url encoded function encode . periods in a url? I'm not sure why it does it by default

This topic has been closed for replies.
Correct answer Dan_Bracuk

use nested functions

yourvar = ReReplace(urlencodedformat(string), pattern));

1 reply

Dan_BracukCorrect answer
Inspiring
January 12, 2010

use nested functions

yourvar = ReReplace(urlencodedformat(string), pattern));