W3C home > Mailing lists > Public > www-validator@w3.org > July 2006

Re: uploading php file.

From: olivier Thereaux <ot@w3.org>
Date: Wed, 26 Jul 2006 13:41:58 +0900
Message-Id: <957236B6-0409-43BF-B7EC-8AD70FCDD7E0@w3.org>
Cc: WWW-Validator Community <www-validator@w3.org>
To: R.Beeman <r.beeman@bee-man.us>

Hi Bob,

I'm coIpying my answer to the www-validator mailing-list, I hope you  
do not mind. I try to document problem solving as much as possible,  
so that it can benefit others later.

On Jul 26, 2006, at 08:48 , R.Beeman wrote:

> Hello Olivier:
> If what is being validated is a page on a web site, validation  
> proceeds correctly and, at least for this file, the result is  
> "passed validation".
>
> If what is being validated is an uploaded file with a .php  
> extension , it fails validation, but if the extension is changed  
> to .htm or .html it passes.

Hmm, this sounds like a problem which does not actually come from the  
validator, let me explain a little more:

the validator can not validate every and anything. For instance, you  
can not validate a jpeg image. In order to find out what documents it  
can or cannot handle, the validator relies on "content type"  
information sent by your server (when validating by URI) or by the  
browser (when validating by upload).

In the case you are experiencing, your operating system (and your  
browser) sends the .php files with a content-type information that  
the validator considers "outside of the range of file types it can  
handle". That's perhaps not surprising: files with .php extensions  
are usually php files, which have to be interpreted by a web server  
to create an HTML document. That's why the .php files are not  
necessarily labeled by your system as being html content.

I would therefore recommend, whenever possible, that you validate php  
documents online, rather that via upload; and if you want to use  
upload validation for documents created by php scripts, they're  
better saved as .html files.


I hope this is a helpful clarification.

cheers,
-- 
olivier
Received on Wednesday, 26 July 2006 04:41:30 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 25 April 2012 12:14:22 GMT