Pergunta

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!

Foi útil?

Solução

It's actually as easy as encoding it twice.

<? 'http://www.mydomain.com/keep-track-of-the-clicks.php?redirect=' . urlencode(urlencode($redirect)); ?>
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top