W3C home > Mailing lists > Public > www-html@w3.org > September 2001

Re: ampersands as literal characters in a URL?

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Fri, 28 Sep 2001 15:07:18 +0200
To: Tony.Rees@csiro.au
Cc: www-html@w3.org
Message-ID: <6ct8rtkvkk97re5p4094emnqafo82e4aal@4ax.com>
* Tony.Rees@csiro.au wrote:
>Maybe somebody can help me. I have some HTML documents which I am trying to
>validate against HTML 4.01 using the HTML validator on the W3 site. I can
>resolve all problems apart from the use of the ampersand character (&)
>within a URL where it performs a function to concatenate parameters which
>are being sent to a CGI script or (in my case) an Oracle PL/SQL procedure.

You have to distinguish between URIs and attribute values,
<a href='script?a=1&amp;b=2'>...</a> really works on almost
all browsers. The URI is still script?a=1&b=2 but with
characters that must be escaped escaped. Not escaping the
ampersand may cause major problems.
Björn Höhrmann { mailto:bjoern@hoehrmann.de } http://www.bjoernsworld.de
am Badedeich 7 } Telefon: +49(0)4667/981028 { http://bjoern.hoehrmann.de
25899 Dagebüll { PGP Pub. KeyID: 0xA4357E78 } http://www.learn.to/quote/
Received on Friday, 28 September 2001 09:08:26 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:05:58 UTC