Page 1 of 1

escaping '&' on the urls?

Posted: Wed Jun 27, 2007 1:59 pm
by pedrotuga
I am trying to validate my site as transitional html but i get a warning because i have a link that looks something like

http://somesite.com/somefile.php?bla=4&bloo=9

i am using Tidy firefox plugin and it sugests this:

Code: Select all

<a href="http://www.domain.com/cgi?x=123&y=456">
Good	<a href="http://www.domain.com/cgi?x=123&y=456">

All special characters in HREF should be encoded. "&" is a reserved character to begin an page.
Solution:

Replace "&" by "&".
The link points to an external site, can i replace '&' by '&amp' in the url without fearing uncorrect query string handling on the external site?

Posted: Wed Jun 27, 2007 2:41 pm
by vigge89
All ampersands in an URL which are not followed by a character entity code (I believe that's what they're called) followed by a semicolon are invalid and should be converted to the entity &
The server shouldn't have any problems with handling the URL.

Posted: Wed Jun 27, 2007 3:06 pm
by pedrotuga
vigge89 wrote:All ampersands in an URL which are not followed by a character entity code (I believe that's what they're called) followed by a semicolon are invalid and should be converted to the entity &
The server shouldn't have any problems with handling the URL.
thank you... i will replace them then.