[thelist] PHP Session ID stopping HTML validation

john at johnallsopp.co.uk john at johnallsopp.co.uk
Fri Mar 31 03:21:36 CST 2006

> john at johnallsopp.co.uk wrote:
>> The problem is PHP wants to put its sessionId between the form and
>> the
>> input: <form method='post' action='myP.php4'><input type="hidden"
>> name="PHPSESSID" value="386bfe3c6ad31ed768ea88c0f3a809e7"
>> /><p><input
>> type='hidden' name='subc' value='1'> ..
>> What's the solution to that?
> Why does it matter - I mean, what dependency is there on the PHP side
> on
> where in the form a hidden field goes? I have never come across a case
> before where the order of "successful" form controls made any
> difference
> to a form handler on a server. How bizarre. PHP sometimes _is_
> bizarre,
> but there must be limits...

I don't think it matters which order the input fields go, but for HTML
validation this:

<form><p><input ..
validates, while

<form><input PHP sessionId><p><input ...

It's the fact that PHP puts its session id field straight after the
<form> tag that's stopping the page from validating.


More information about the thelist mailing list