W3C strict validation and session_start() input hidden issue - not passing
June 30th, 2008
Couple of days ago, I’ve finished building a new website of mine for Design to XHTML service. One of the things needed for a such a project is having the page(s) passed W3C Strict Validation.
Everything was cool except for the phantom hidden input field that was holding PHPSESSID value. The problematic input field was positioned right after the <form> tag, and you can’t have that if you want to pass W3C strict. You have to enclose that field with a <p> or a <div>.
I’ve installed a JQuery SWFUpload for easy & user friendly upload experience, so I thought that script might be the one causing trouble. I’ve spent an hour running through lines and lines of code and couldn’t find nothing relating to my problem.
Since that was the only exotic part of code I was inserting, I turned over to session_start() as my primary suspect. I’ve stripped everything from the page, left only the form and the session_start() function call. Uploaded, W3C verified and that was it! For some reason session_start() invoked another hidden field in my form that didn’t render in my Firefox or Safari, but only in W3C. Knowing that, the only solution was simple:
if(!strstr(”$HTTP_USER_AGENT”, “Validator”)) {
session_start();
}
All I can say is I hope this saves somebody an hour of his life.
Technorati Tags: w3c, strict, validation, session_start, input, hidden, not passing













One piece of software I’m really missing after crossing over to Mac from a PC is
Here’s an old thought for you, just as a reminder: When building backlinks, consider the sites that share a common theme with yours first. If you can’t find enough websites to link back, you can ask the webmaster of a site that’s not themed similar to yours to write an article that’s theme related to your website. Better yet - write it yourself and send it to him.
Last September I’ve conducted a ‘
Couple of days ago I’ve came to a conclusion that I definitely need some sort of intranet, a way to track all of my projects and share project specs with my future employees.
I own a Macbook Pro, and unlike it’s pre-descendants it has some wake from sleep issues described and resolved
Good old Ed Dale is back with
As you already know, Apple has released Iphone SDK earlier this month. It is available for free download at 

