문제

I'm busy developing my own newsletter system where I also want to keep track of the links users click. I prefix every url with my my own statistics url and urlencode the original url.

For instance

 <a href="http://www.domain.com/some-page">Go to domain.com</a>

Becomes

 <a href="http://www.mydomain.com/keep-track-of-the-clicks.php?redirect=http%3A%2F%2Fwww.domain.com%2Fsome-page">Go to domain.com</a>

This works perfect in mail clients but not in webmail clients. They auto decode the encoded url causing errors in my script.

Does anybody know how to work around this?

Thanks in advance!

도움이 되었습니까?

해결책

It's actually as easy as encoding it twice.

<? 'http://www.mydomain.com/keep-track-of-the-clicks.php?redirect=' . urlencode(urlencode($redirect)); ?>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top