This Page Is Valid XHTML 1.0 Strict!
December 8th, 2006 by morning
It is.
The problem I had, mentioned in previous post, was odd and at first I didn’t have a clue where it was coming from. Basically, w3 validator was reporting an error that input field wasn’t within block level element which is required to validate correctly in XHTML 1.0 Strict and XHTML 1.1. I did put input tags between fieldset, but error was still remaining. Form elements on index page were within fieldset and when I checked page source, it looked fine to me, and I couldn’t figure out how come validator reads my page differently. Problem lied at server side and PHP settings. Next thing I checked was phpinfo and realized that I was running PHP 4.4.4 with register_globals, magic_quotes_gpc and session.use_trans_sid set to on!!! /Yes, believe it or not, hosts which leave those setting turned on by default still exist! I’m afraid reason for that are crappy coders which probably request those things./ Apparently, when session.use_trans_sid is set to ON, PHP rewrites the form to add hidden input field with sessionid and it places it just after form tag. There are few solutions to this problem:
1. Turn session.use_trans_sid to off in php.ini or with .htaccess
2. If you have access to php.ini and need session.use_trans_sid to be set to on, you can change url_rewriter.tags = “…, form=fakeentry” to url_rewriter.tags = “…, form=action”. Downside of this method is that you will always have session id as $_GET parameter, even when you defined form method as POST.
I was thinking to override those settings with .htaccess, but I was lazy enough and after all, DreamHost allows you to switch between PHP4 and PHP5 with just one click and I was hoping that PHP5 on their server comes with all those settings turned off. And I was right. 
- Posted in Programming, Web development

7 Responses to “This Page Is Valid XHTML 1.0 Strict!”
Good job woman!
You have made my night.
I have just finished the last stage of my first ever WordPress theme creation… validating XHTML 1.0 Strict.
A couple years ago I didn’t know anything about webpages other than you could make one up in Microsoft Word and put it on the net.
That’s what I did, believe it or not, to find the woman I love. You can read about it here, but please, in the name of God, DO NOT check the source code! It’s still narly.
LovingJacqui.net: “How I Turned My Back on Empty Relationships and Discovered Amazing Fulfilling Love with Bear”
Then some time later I signed up for a Blogspot blog so I could have a way of communicating with and keeping in love with this gorgeous girl from Australia.
I soon put it on my own web host and have been learning HTML, then XHTML and CSS since then.
And it’s been fun. I’ve enjoyed it.
Now, I’ve launched my business site, converted it to a WordPress theme after several false starts and giving up several times, tweaked it out with features and plugins, and validated it… the last thing I could not do was get rid of the pesky PHPSESSIONIDs.
I tried every complex solution you could imagine… and then I found your post… like you, I’m on DreamHost, and like you one click, upgrade to PHP 5.2.3, and now I can roll out the validation buttons on each page, not just my hand coded static pages (put together by PHP includes).
You rock my world. I love my “Bear” more than anything in the world… but tonight, you are a very close second.
Drop by either of our blogs, especially the personal one, and leave us a comment!
ChristophDollis.com my business blog… the one which you held make la piece de la resistance a reality!
Merci Beaucoup.
*helped
You, did, Jelena by helping me get rid of the PHPSESSIONIDs messing up my form validation.
Unfortunately, my stylesheet switcher at ChristophDollis.com doesn’t work in PHP 5.2.3 so I had to fall back to PHP 4.4.7.
When I get time, I’ll install a new one! Right now. everything is written to XHTML 1.0 Strict standards and, more importantly, everything works.
Would you believe I had to troubleshoot one last error?
I kid you not — Internet Explorer 7 gave me a Javascript error and wouldn’t get rid of it until I changed my hyperlink text.
“Subscribe to posts” — fine according to IE.
“Subscribe to blog via email”?
Nothing doing. That was causing IE to throw up an error, not the many Javascripts all of which I disabled to troubleshoot. That’s got to set some kind of record for crazy IE weirdness.
Your site has awesome design! Love the coffee. Could use a cup.
[Cross posted at: LovingJacqui.net, but the website we’re talking about is at ChristophDollis.com]
Cool info on the php session id thing… was driving me crazy. Thanks!
When I started website building I didn’t care much for the ‘coding standards’ but it’s only in the past year I’ve realised that its quite nice to do it just for the achievements. Also people who aren’t very web-savvy always sound quite impressed when you say its XHTML Valid. I made my blog and all templates i made XHTML and CSS Valid, took me about a week to perfect them all, but i’m glad i did it.
Sorry, one more thing, now your blog is xhtml valid you should get yourself some valid icons from W3 Validator just to show off your hard work :-)
Have something to say?