I have three checkboxes ,the user should check one or 2 choices.
when I checked 2 choices an error message appear.
$workshop1Day1 = $_POST["workshop1Day1"];
$workshop2Day1 = $_POST["workshop2Day1"];
$workshop3Day1 = $_POST["workshop3Day1"];
$requete = "INSERT INTO Participant ( NameSurname,workshop1Day1,workshop2Day1,workshop3Day1)
VALUES ('$NameSurname', '$workshop1Day1', '$workshop2Day1', '$workshop3Day1')";
$result = @mysql_query($requete);
error:
Notice: Undefined index: workshop3Day1
Then I have tried the following code (eg :in case the checkbox number 3 not checked),the same error appear
$workshop1Day1=' ';
$workshop2Day1='';
$workshop3Day1='';
$workshop1Day1 = $_POST["workshop1Day1"];
$workshop2Day1 = $_POST["workshop2Day1"];
$workshop3Day1 = $_POST["workshop3Day1"];
if (isset($workshop1Day1)&& isset($workshop2Day1)&& !isset($workshop3Day1))
{
$requete = "INSERT INTO Participant ( NameSurname,workshop1Day1,workshop2Day1,workshop3Day1)
VALUES ('$NameSurname', '$workshop1Day1', '$workshop2Day1', '$workshop3Day1')";
$result = @mysql_query($requete);
i know that isset is the solution but how?