This is what I do. On every page that I want track whether or not the user has JavaScript enabled or not I have a hidden field like:
<input type="hidden" name="jscript" value="false">
Then in the page's <body> tag I call the following function:
onload="check_java(window.document.forms[0])"
That function sets the value of the hidden field to "True". When I go to process the page with PHP I then can check the value of the hidden field and it will be "False" if JavaScript is disabled since the onload function will never have happened.
Hope that helps