I have a form where people need to submit information. This part of code is not working how I want it and I don’t know why..
if (!isset($_POST['maandag']) && !isset($_POST['dinsdag']) && !isset($_POST['geenvoork']))
{
echo "Je bent vergeten in te vullen wanneer je aanwezig bent.";
}
the posts do work in the rest of the form, and are correct. What I want is to check if those 3 checkboxes are not checked. What am I doing wrong?
If they are in your form then they will be set. You likely want to check if they are false. Here’s what it is for one, you can combine the others:
Secondly the code as is means that you’ll only get the message if none of the checkboxes are set. I’m not certain, but if you’re trying to throw an error message don’t you want it if any of them are not set? In which case you need
||(or) not&&(and).