[thelist] PHP Session ID stopping HTML validation

john at johnallsopp.co.uk john at johnallsopp.co.uk
Fri Mar 31 04:34:53 CST 2006


>> On 3/31/06, john at johnallsopp.co.uk <john at johnallsopp.co.uk> wrote:
>>> Hi ppl
>>>
>>> I'm trying to create a valid HTML 4.01 Strict web page and the W3C
>>> Validator seems to require me to put a containing element around
>>> the
>>> <input>s, eg. <p>. It's not accepting <p><form>.., requires
>>> <form><p><input.. >
>>>
>>> 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'> ..
>>
>> Not sure about the PHP apsect.
>>
>> Could you use a fieldset inside the form? maybe PHP would place the
>> sessionId inside the fieldset, which should help validate.
>>
>> ben
>
> Thanks Ben, that worked, once I'd sorted out a legend too, and I
> didn't need the <p> after all:
>
> <form method='post'
> action='myP.php4'><fieldset><legend>Reg</legend><input type="hidden"
> name="PHPSESSID" value="d7934eec6b91b328daf311d5c28edfa0" /><input
> type='hidden' name='sub' value='1'><input type='hidden' name='uc'
> value='1'><input type='image' src='images/reg.gif' name='reg'
> alt='Register' title='Register'
> onMouseOver="this.src='images/rego.gif';"
> onMouseOut="this.src='images/reg.gif';"></fieldset></form>
>
> Cheers
> J

Correction, no it didn't work. It worked in my *false* test page, but
when I've just implemented it properly on the site, PHP still puts the
SESSID outside the fieldset.

I really am going to have to work out the implications of Max's advice.

J



More information about the thelist mailing list