I'm having issues with a external link that has several ':' in it's link and is not working correct. Via urlencode I can change this character to %3A which works, but inside a it pastes the link behind the URL the user is currently viewing.
The external link (in this case $url) looks like this:
https://prf.hn/click/camref:somestring/creativeref:somestring/destination:https://www.example.org/product/productname.html
I currently try to print it the $url this way:
<a href="<?php echo urlencode(html_entity_decode($url) ) ; ?>">
This currently results in, which doesn't work:
https://example.net/page/https%3A%2F%2Fprf.hn%2Fclick%2F
Instead of, what should work:
https://prf.hn%2Fclick%2F
What am I doing wrong?
question from:
https://stackoverflow.com/questions/65898257/php-urlencode-pastes-home-other-domain-in-one-url 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…