views:

84

answers:

2

The following link to a URL in my application is giving me an XML Parsing Error on the second equals sign when I try to view the page.

<a href="http://www.example.com/admin/banning.php?do=banuser&amp;u=3"&gt;Ban User</a>

I think the problem is the ampersand in the URL. If I encode the ampersand the parsing error goes away but the URL no longer functions. Is there an easy way to get URLs like this to work in a page being served as XHTML?

+2  A: 

Encoding the ampersand is the correct way. If the URL doesn't work, something else must be wrong.

Jens
What I don't get is that pasting the URL into my browser gets the correct result yet when I encode the ampersand using %26 it breaks.
Urfe
Urfe
Peter Boughton
A: 

you have to use &amp; instead of & in any xhtml-document

Sergey Kovalenko