Reputation: 101
I am using a validation tool and it is returning errors that the page has parsing errors Found '&'. You should use '&' instead
found in php-style links (i.e. < a href="index.php?route=home&path=1">
is incorrect whereas < a href="index.php?route=home&path=1">
is considered correct). What standards does this break? I thought it was normal practice to use & in URLs. The website is written in PHP.
Please note that I am not looking for support on the software. I'm just curious to know what part of the standards I may be breaking.
Upvotes: 1
Views: 5181
Reputation: 943217
This has nothing to do with accessibility or URLs.
&
is a special character in HTML which means "start of entity".
To say "An ampersand" instead of "Start of entity" in HTML you should use the entity for ampersand: &
.
There are times when you can use a raw &
in HTML, but it is simplest to always use &
instead of trying to remember the times when it is optional.
(Exception: You must use a raw &
are inside <script>
and <style>
elements.)
Upvotes: 4