php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20744 Browser output is not XHTML compliant
Submitted: 2002-12-01 06:37 UTC Modified: 2002-12-01 14:29 UTC
From: sp at m-me dot dk Assigned:
Status: Closed Package: Session related
PHP Version: 4.2.3 OS: All
Private report: No CVE-ID: None
 [2002-12-01 06:37 UTC] sp at m-me dot dk
I constructed a test site to show my point:
http://www.wopr.dk/misc/formproblem.php

If you click at the "W3C XHTML 1.1" picture you will see that the site contains one error:
"document type does not allow element 'input' here"

The input element the validator refers to is this one:
<input type="hidden" name="PHPSESSID" value="d509686534734e1c5b1ac66ef2a54c2e" />

The problem is that according to the XHTML standard all input elements should be contained inside a block level element (like in my case a div element). The session engine in PHP puts the session ID tag just after the opening form element.

Instead it should look for the first input, textarea etc. element inside the form and put the hidden session input element just before that.

Of cause action also has to be taken if no such element is contained inside the form.

Look at this link for another description of the problem (not PHP related):
http://lists.w3.org/Archives/Public/www-validator/2001Sep/0114.html

/watson

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-12-01 09:33 UTC] msopacua@php.net
I'm not sure this should even be fixed.

It's a clear flaw in the XHTML 1.1 spec, as an input element with type 'hidden', has no layout impact whatsoever, and as such it should not be burdoned with the rules that apply to an inline element.

 [2002-12-01 14:29 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 [2003-05-31 17:05 UTC] taupe at taupe dot myhost24 dot com
It's wrong.
It's still bugging in PHP 4.3.2 ...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 04:01:27 2024 UTC