I just want php to determine if the checkbox is checked, but I ran into the problem of getting the correct return. Help me please.
My html code
<label>
<input name="Language" type="checkbox" id="aa" checked="checked" />
One</label>
<label>
<input name="Language" type="checkbox" id="bb" />Two</label>
<label>
<input type="checkbox" name="Language" id="cc" />Three</label>
I pass php values with the $ _GET method
my php code is:
$aa=$_GET["aa"];
$bb=$_GET["bb"];
$cc=$_GET["cc"];
echo $aa."<br>";
echo $bb."<br>";
echo $cc."<br>";
exit true false lie
Then I just want to determine if each cell is checked, and if so, do something.
if ($aa == true) { $abc="checked";}
else { $abc="not checked"; }
if ($bb == true) { $cde="checked";}
else { $cde="not checked"; }
if ($fgh == true) { $fgh="checked";}
else { $fgh="not checked"; }
But if statements always return true, even if the checkbox is unchecked. I tried the options "===" and "! =", But it does not work.
TIA
jamex source
share