First of all, hope you noticed the missing double quote on your HTML code you posted (the missing quote will close the 'type' attribute).
Second, check out this post I made a few minutes ago concerning the difference between strings and constants, as you are having the same problem.
Last but not least, checkboxes to not return "on" or "off". If the box is not checked, it is not even sent as a POST'd element; it doesn't exist. To easily check for the value in this situation, you can do one of three things:
- Surpress the notice about using an 'undefined index' (undefined because it wasn't POST'd) using the at (@) sign:
if (@$_POST['complexity'] == 'on')
- Don't check it's value, rather, check if it's even set using a function that WON'T generate a warning if you use a non-initialized variable/index:
if (isset($_POST['complexity']))
- Essentially combine the two methods: surpress the warning about an undefined index/variable, and check to see whether it exists or not:
if (@$_POST['complexity'])
Hope this clears things up a bit for you.