links with query strings not validating

T

TheKeith

I have a page written in php that generates an xhtml strict page with
some links having query strings attached at the end of the url,

e.g., www.abc.com?blah=blah&blah2=blah2

This is not validating on the w3 validator. Why not? Why are query
strings not valid? Is there any way to change them at all to make them
valid? Creating a separate 'get' form for each one would not be practical.

help would be appreciated.
 
S

Steve Pugh

TheKeith said:
I have a page written in php that generates an xhtml strict page with
some links having query strings attached at the end of the url,

e.g., www.abc.com?blah=blah&blah2=blah2

This is not validating on the w3 validator. Why not? Why are query
strings not valid? Is there any way to change them at all to make them
valid?

Just change & to &

Steve
 
C

C A Upsdell

TheKeith said:
I have a page written in php that generates an xhtml strict page with
some links having query strings attached at the end of the url,

e.g., www.abc.com?blah=blah&blah2=blah2

This is not validating on the w3 validator. Why not? Why are query
strings not valid? Is there any way to change them at all to make them
valid? Creating a separate 'get' form for each one would not be practical.

Your query statement refers to the nonexistent character entity &blah2;

Replace & by &
 
E

Ed Koren

TheKeith said:
I have a page written in php that generates an xhtml strict page with
some links having query strings attached at the end of the url,

e.g., www.abc.com?blah=blah&blah2=blah2

This is not validating on the w3 validator. Why not? Why are query
strings not valid? Is there any way to change them at all to make them
valid? Creating a separate 'get' form for each one would not be practical.

help would be appreciated.

Hi there,

Perhaps you could use [ & ] instead of [ & ] in your markup. That
way, it should validate.

Ed
 
N

nice.guy.nige

While the city slept, TheKeith ([email protected]) feverishly typed...
I have a page written in php that generates an xhtml strict page with
some links having query strings attached at the end of the url,

e.g., www.abc.com?blah=blah&blah2=blah2

This is not validating on the w3 validator. Why not? [...]

As others have stated, you should use & in your URI's.

Being the curious type (as in "inquisitive", not "odd"!) I knocked up a test
page containing a link such as your example and ran it through the W3C
validator. A description of the error contained the following text;

"An entity reference was found in the document, but there is no reference by
that name defined. Often this is caused by misspelling the reference name,
unencoded ampersands, or by leaving off the trailing semicolon (;). The most
common cause of this error is unencoded ampersands in URLs..."

.... and in the next paragraph...

"...If you want to use a literal ampersand in your document you must encode
it as "&" (even inside URLs!). ..."

.... so, unless this is a very new addition to the validator's error report,
how come you failed to notice this, and hence have all the information you
needed to fix your problem, before your post to the newsgroup?

Cheers,
Nige
 
T

TheKeith

I'll do what everyone suggested--thanks. The reason I asked the
question, instead of just listening to the validator is because I
thought the query string syntax was a standardized thing--I thought
perhaps it might be a problem with the validator. Thanks again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top