I am trying to encrypt URL parameters using AMPScript but I have an issue with the encrypted parameters, they include symbols like
=. 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.
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:
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.
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
+ (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
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