I'm getting this error at W3C validator:
Bad value
https://www.ncbi.nlm.nih.gov/snp?term=c.1047A>T
for attributehref
on elementa
:Illegal character in query:
>
is not allowed.ar</a> or <a href="https://www.ncbi.nlm.nih.gov/snp?term=c.1047A>T" target="_blank">dbSNP<
I tried change >
to >
, but it didn't work, and I need pass this character at URL: >
. I tried to use urlencode()
function from PHP and htmlentities()
, but it didn't solve this error.
A piece of code:
<a href="https://www.ncbi.nlm.nih.gov/clinvar/?term=c.-247C>T" target="_blank">ClinVar</a> or <a href="https://www.ncbi.nlm.nih.gov/snp?term=c.-247C>T" target="_blank">dbSNP</a>
<a href="https://www.ncbi.nlm.nih.gov/clinvar/?term=c.-316T>C" target="_blank">ClinVar</a> or <a href="https://www.ncbi.nlm.nih.gov/snp?term=c.-316T>C" target="_blank">dbSNP</a>
This code is to generate a direct URL into a external search using all data from the DB and need to use >
character.
How I can fix this
You have to url encode them, not HTML encode them. The correct code for > is %3E
.