简体   繁体   中英

Proper ampersand handling in e-mail activation link

In e-mail activation links I return

<a href="http://www.foo.com/register.php?action=activation&key=123">Activation</a>

In some clients (eg SquirrelMail) & is changed to &amp; which breaks the link.

<a href="http://www.foo.com/register.php?action=activation&amp;key=123">Activation</a>

How can I make sure the link is displayed correctly in all e-mail clients?

Have you tried URL-escaping the ampersand?

<a href="http://www.foo.com/register.php?action=activation%26key=123">Activation</a>

FWIW, the

<a href="http://www.foo.com/register.php?action=activation&key=123">Activation</a>

is a perfectly fine bit of HTML data, and i believe your issue is actually showcasing a bug in SquirrelMail.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM