Вопрос

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