urlenconded url用于webmail客户端的统计信息(urlenconded url's for statistics in webmail clients)
我正在忙着开发自己的新闻通讯系统,我也希望跟踪用户点击的链接。 我在每个网址前加上我自己的统计网址和urlencode原始网址。
例如
<a href="http://www.domain.com/some-page">Go to domain.com</a>变
<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>这在邮件客户端中非常有效,但在Webmail客户端中却不行。 他们自动解码编码的url,导致我的脚本出错。
有人知道如何解决这个问题吗?
提前致谢!
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!
最满意答案
它实际上就像编码两次一样容易。
<? 'http://www.mydomain.com/keep-track-of-the-clicks.php?redirect=' . urlencode(urlencode($redirect)); ?>It's actually as easy as encoding it twice.
<? 'http://www.mydomain.com/keep-track-of-the-clicks.php?redirect=' . urlencode(urlencode($redirect)); ?>更多推荐
发布评论