Page 1 of 1

php session and xhtml compatibility

Posted: Sun Oct 13, 2002 9:54 am
by wolf
Hi,

I am using sessions in php but would like to have the resulting html page compatible with xhtml1.1. This however seems not to be possible because php inserts a line
<input type="hidden" name="PHPSESSID" value="..." />
right after the <form> tag:
<form action="error_report1.php" method="post">

The validation will tell me: Error: element "input" not allowed here; possible cause is an inline element containing a block-level element

Grateful for the solution!

Many thanks

Wolfgang

Posted: Sun Oct 13, 2002 10:10 am
by volka
do you have something like a <table> in your form?
you may turn off session.use_trans_sid in php.ini and only use cookies for sessions.
If you don't like cookies you may delete the form-entry from url_rewriter.tags and write put a apropriate entry in the form yourself (all the time)

Posted: Sun Oct 13, 2002 10:21 am
by wolf
1)
It goes like this:
<form action="error_report1.php" method="post">
<div>
<table summary="error report form">

however, php inserts its line right after the "post"> and before the <div>...

2)
I cannot change php.ini because I have no access to it

3)
I have never heard about url_rewriter.tags, but searching for it it turned out that the behaviour I reported is already a known php bug and is expected to be fixed in php 4.3. So: Many thanks!

Posted: Sun Oct 13, 2002 10:29 am
by volka
if cookies are enabled for session-support you might try to disable trans_sid within your script.

Code: Select all

ini_set('session.use_trans_sid', 0);
Unsure wether scripts can change this parameter or not. Put it a the top of the script if you want to try