PHP session tracking in forms generating invalid markup (was Re: Error Message Feedback)

On Sun, Feb 12, 2006 at 07:03:44PM +0100, DifVgg Vorstand wrote:

> i 've got the following problem: validating my page (html 4.01 strict), 
> the validator complains about this line:

> <form action="?log=login_r" method="post"><input type="hidden" 
> name="PHPSESSID" value="46eda3e63dbdf10bc67f702249d90bda" />

Presumably because <input>s cannot be child elements on <form>
elements (although the XHTML-style self closing / is also incorrect in
HTML documents - it is valid, but has different meaning.)
 
> *i can understand, why it is complaining*, but unfortunately i don't 
> know how to fix it. the hidden input field containing the session id is 
> not within my original html-code. it is generated by PHP.

> i don't want to switch the auto-append-session function and add it 
> "manually", if possible..

Generating the HTML by hand was the advice I recieved (from PHP
experts) when I had that problem. I'm not aware of anything
better. (Frankly, I don't consider any of the HTML generating code
built into PHP to be any good.)

(I read the mailing list. Please direct responses there and do not CC
me. Thank-you).

-- 
David Dorward                                      http://dorward.me.uk

Received on Monday, 13 February 2006 09:46:22 UTC