From: Swen T. <swe...@te...> - 2003-03-25 15:44:03
|
On Tue, Mar 25, 2003 at 10:41:53AM -0500, Chris Winters wrote: > > This is one of those issues that I was too lazy to research and > went with what worked. Do GET parsing engines regard a lone '&' > as an error? Do '&' and ';' work with everything? Hmm. I do not know what you mean with "GET parsing engines". The problem is, that you have to make a distinction between HTTP and HTML here. The HTTP protocol defines '&' as the parameter separator. Since HTML is an SGML dialect or instance, the & has to be encoded in HTML as &, because & is special in SGML (and XML), it starts an entity (as ö or &oring; etc.). So in HTML you have to write something like <a href="blah?b=1&c=3">... The browser then decodes the entity & to & and uses this in the GET request for HTTP: GET blah?b=1&c=3 HTTP/1.0 A problem arises, when you want to do a redirect. If you have for example a library method redirect($url), which does not decode the entities, then you must not use & in the URL, you have to use & Most browsers allow you to use & in URLs, so you normally will get away with this, but this will not be the case for XHTML, which has to be wellformed XML. My guts feeling is, that ';' as separator might not work with every HTTP server, but I do not really know this. Hope this helps. Greetings, Swen |