php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #20202 Form elements id Attrbute Ignored
Submitted: 2002-10-31 14:36 UTC Modified: 2002-11-01 05:22 UTC
Votes:1
Avg. Score:2.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: raffaele at vpresence dot com Assigned:
Status: Not a bug Package: Feature/Change Request
PHP Version: 4.2.2 OS: WinXP SP1
Private report: No CVE-ID: None
 [2002-10-31 14:36 UTC] raffaele at vpresence dot com
PHP seems to ignore the id attribute given to form elements. It just consider the name attribute

So while a element  like <input type="text" name="first_name" /> will create a $_post["first_name"] variable if submitted, for exemple, the similar tag <input type="text" id="first_name" /> will not create any variable.

The problem is that in the XHTML 1.0 W3C specs the "name" attribute is depreached in favor of "id". This could cause problems in the near future where XHTML whill be more widespread.

It would be appreciated if the "id" attribute handling is added to future PHP releases.

Info:
I installed PHP on my WinXP SP1 for use with IIS using the included installer and use all the default choices.

My inst

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-10-31 14:46 UTC] raffaele at vpresence dot com
W3C Specs page about id attribute in XHTML 1.0 is at http://www.w3.org/TR/xhtml1/#h-4.10
 [2002-10-31 14:48 UTC] derick@php.net
This is up to the browser to do. Did you verify with a line sniffer / network tracer to see what happened? My bet is that the browser didn't send the data correctly, and of course PHP doesn't record it then.

Derick
 [2002-10-31 18:50 UTC] raffaele at vpresence dot com
OK so, I trace Moziila 1.1beta Win32 with HTTPTrace 2.0 and indeed you were right , when only the "id" attribe is set mozilla does not send the content of the element. 

Unfortunately the program did not work with the other browser but I suspet the same issue is involved.

For information I tested : Moziila 1.1b, Opera 6.01, Amaya 6.4  and Internet Explorer 6.0 SP1 on Win32 and Mozilla 1.0, Lynx and Links, Konqueror on Linux.

Every browser reported the error but acted differently some time . IE6 for exmple did not even report the PHP error message as Mozilla did.

The XHTML 1.0/1.1 still accept the name attribute as does XHTML Basic but I do believe that UA developpers should correct this issue for the future
 [2002-11-01 05:22 UTC] derick@php.net
Okay then, not a error/problem in PHP so we mark this as "bogus".

Derick
 [2002-11-01 07:53 UTC] m dot ford at lmu dot ac dot uk
I'd just like to add that raffaele@vpresence.com is actually incorrect, and there is nothing to "correct" here.  Quoting from the URL s/he posted before, the name attribute is deprecated *only* for the a, applet, form, frame, iframe, img, and map tags.  It is most definitely *not* deprecated for the individual form element tags, and indeed is an integral part of the XHTML spec for those tags.

Cheers!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 15:01:28 2024 UTC