Sometimes, when I submit a form that gathers checkbox data, the checkbox data displays perfectly and other times, the values don't display at all. Any ideas what could cause this?
- A typo in your code
- You misunderstand how checkboxes work
- Ineffective debugging logic
- Bad logic to begin with
Those would be the most likely causes. If you share some code and a more specific example I bet it can be narrowed down even further.
You probably have a problem with your URL structure. You may be trying to post data to a URL thats different then your current location. This tends to look like a cross site scripting attack and the server won't be able to grab your posted variables in this case.
Example of what I'm talking about:
I have a form here: http://www.mywebsite.com/myform.php
Now I try to submit the form to: http://mywebsite.com/myform.php
To a user this seems fine but the server thinks that the www. version of the site is a different website and doesn't grab your variables.
For consistency you should always force a user to either the www. or non www. version of your website using a .htaccess file.
Hope that helps.