when the link is clicked containing the @ symbol, the url gives me %40, which is what I want. But once I click it, one second later it changes to %2540 right after I click. The click is within an email, then directed to the site, where %40 changes to %2540. How can I make it stop changing?
it is getting the params like this now:
$email=Yii::app()->request->getParam('email');
not sure what other information i should provide.
It happens when you are trying to call urlencode on a query string when you've already done it. So, the first call gives you %40 instead of "@". And the second call gives you %25 instead of %
There's not enough detail in your question to work out exactly why, but I can tell you at least what it is that's going on, and that should give you some clues.
A "@" has an ASCII code of hex 40, so when it gets escaped (i.e., turned into something without any special characters in it), it becomes "%40". But a "%" has an ASCII code of hex 25. If you escape a "%", you get "%25".
Your text is getting escaped twice: first to go from "@" to "%40", and then again to go from "%40" to "%2540".
The issue is that your
%40
is url-encoded again (since%
encodes to%25
), which gives you%2540
.