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