Myreader.co.uk  
uk news, chat and community
   home   |   control panel login   |   archive   |  
 
net
net
news.announce
news.config
news.management
news.moderation
providers
providers.aaisp
web.authoring
  
 
date: Sun, 01 Jun 2008 23:32:36 +0100,    group: uk.net.web.authoring        back       
Re: Validation faliure due to URL...???   
On Sun, 1 Jun 2008 19:48:42 +0100, ":Jerry:" <INVALID@INVALID.INVALID>
wrote in <g1uquv$au2$1@registered.motzarella.org>:

>But my question was about the php variables passed within a URL, what 
>if that html code contains, possibly server side generated, multiple 
>php variables in it (such as www.example.com?cow=2&sheep=3&pigs=2), 
>whilst I can see that there is a problem with browsers misinterpreting 
>ampersands and what follows surely this is a php coding issue and not 
>a browser or html issue - IOW the person writing the php should be 
>aware of the problem and *not* use a text string as a variable that 
>could be misinterpreted whilst the validators should be intelligent 
>enough to ignore php variables within a URL? 

The part of a URL that follows the '?' is the "query" in the
nomenclature of RFC3986. The conventions for browsers encoding form data
into a query and how it would be passed to a server side mechanism for
decoding and processing were set out as part of the Common Gateway
Interface before PHP was invented. See
<http://hoohoo.ncsa.uiuc.edu/cgi/forms.html> for details. The 'query' is
often called the "query string" perhaps because in CGI it is passed as
the value of the QUERY_STRING environment variable.

As for how you write URLs in an HTML page, the issue is really very
simple. In HTML (also XML and other SGML-based languages) ampersand is
written '&' where in plain text it would be written '&'. If you are
writing to a plain text context (e.g. a GET request in the HTTP
protocol) you write ampersand as '&'; if you are writing to an HTML
context (e.g. delivering the content in a response of type text/html)
you write ampersand as '&'.

The spelling of ampersand does not magically change when writing the
value of the href attribute of an a element any more than it changes
when writing any other attribute. Any program that wishes to generate
syntactically correct HTML must perform the appropriate conversion at
the point where it takes data from a plain text context and writes it to
the HTML.

The whole point of a validator is that, unlike most web browsers, it
does not silently fix up markup errors in an attempt to show you
something. A very important use of the validator is to tell you that the
HTML is wrong so that you can fix whatever generated it.

-- 
Owen Rees
[one of] my preferred email address[es] and more stuff can be
found at <http://www.users.waitrose.com/~owenrees/index.html>
date: Sun, 01 Jun 2008 23:32:36 +0100   author:   Owen Rees

Google
 
Web myreader.co.uk


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us