--enable-trans-sid and HTML 4.01 compliance

From: Date: Fri, 12 Oct 2001 12:36:23 +0000
Subject: --enable-trans-sid and HTML 4.01 compliance
Groups: php.general 
Request: Send a blank email to php-general+get-70924@lists.php.net to get a copy of this message
Hi, I am interested in making my PHP pages HTML 4.01 transitional compliant. One of the conditions for this is that all ampersands in the document be the beginning of entity references. This includes those embedded in the query strings of links: BAD http://www.php.net/?foo=bar&bar=baz GOOD http://www.php.net/?foo=bar&bar=baz My problem is that I am using sessions and would like to keep the functionality of --enable-trans-sid. This adds the session name and ID to certain URLs in the page. But it does it with '&' in the non-HTML4 way. There doesn't seem to be a way to change the separating character that PHP uses to append session name and ID to the url, either by configure directive, .htaccess, or on-the-fly. Or is there? What other ways can I get around this? I tried output buffering the whole page and fixing the naked ampersands with a regexp, but it seems like the url adapting is done between the true end of the script and the output to the browser. Another solution: turn trans-sid off and roll my own, output buffering and adding session name and ID to all important urls manually, using the "right" sepchar. This seems redundant and slow. Anyone tried to get around this before? I found some PHP sites that boasted HTML 4.01 compliance, but when I ran them through validator.w3.org they had the same problem I did. Or is it that older browsers don't understand & in the url, and PHP wants maximum compatibility rather than maximum compliance? Rock on, Matt -- ---------------------------------------------------------------- Matthew Leingang http://www.math.rutgers.edu/ Rutgers University leingang@math.rutgers.edu Department of Mathematics /usr/games/fortune says: A man usually falls in love with a woman who asks the kinds of questions he is able to answer. -- Ronald Colman

« previous php.general (#70924) next »