I am trying to encrypt URL parameters using AMPScript but I have an issue with the encrypted parameters, they include symbols like +
or =
. So they cannot be used as strings in a URL parameter.
Is there any solution for that? I have tried the encrypting functions in AMPScript but I do not know if there is a way to restrict the encrypted string to a set of chars that does not include special chars.
Edit:
Thanks for the answer but it does not solve the issue. If there are only one parameter and it contains = or ? the amp will not identify the string. Look at the example:
URL
www.whatever.com/?string1=2343?23=
AMPcode in HTML page
%%[ SET @example = Requestparameter ("string1") ]%%
<p> string1: %%=v(@example)=%% </p>
You would expect that the html displayed 2343?23=
but it is not displaying anything. You can also try with the string 2342&3234
then the page will display 2342
only. Therefore you can see that one parameter does not solve the problem. Unless I missed something. Anyway thanks.
Edit 2:
The parameter is one of the fields of the subscriber (i.e. email), I encrypt the parameter and I place it in the link. Something like this href="www.whatever.com/%%=v(@example)=%%"
. Then in the landing page I want to decrypt the parameter and it is there where I have problems if the encrypted parameter contains &
or +
(not sure if other symbols may also make it not work).
Let me share the code I am using to validate the encryption / decryption works.
%%[ SET @example = Requestparameter ("parametro") ]%%
Parameter: %%=v(@example)=%%
These are some examples of not being able to obtain the complete string in AMP
www.whatever.com/?parametro=23+&24=
Then in AMPScript the variable gets the value 23
www.whatever.com/?parametro=2a&der
Then there is an error in the code
I know that this is the expected behaviour this is why I am looking for an encryption function that does not generate chars like &
or +
.
http://pages.s6.exacttarget.com/page.aspx?QS=1550dccf35ce5f74eaa21800101bc599579368cf38f97db2&string1=2343?23=
and returnedstring1: 2343?23=
on the page. I think we are missing something. What code are you using to encode the url, and how is it being parsed?&
in a query parameter is malformed anyhow. You would want to replace those query strings with%26
+
work, or no? When do your params get encoded? What code are you using to do that?