Hello, I am very new to PHP so appologies if the code is awful. I am sure that someone will give me a simple answer!
I have also used a few lines to test for myself. I have an HTML form that passes the variable chkno[] through to the seperate PHP file. Chkno[] is an array of 3 checkbox buttons.
<input type="checkbox" id="chkno" name="chkno[]" value="(Go)"/>
<input type="checkbox" id="chkno" name="chkno[]" value="(No GO Sector)"/>
<input type="checkbox" id="chkno" name="chkno[]" value="(No GO Full Form)"/>
When I do not click any of the buttons, my little test at the bottom returns "not empty"!? Surely it should be empty if I don't press anything? That is what I am aiming for anyway. Please can anyone help?
$chknotest0 = $POST['chkno'][0];
$chknotest1 = $POST['chkno'][1];
$chknotest2 = $_POST['chkno'][2];
$chknotest=array("$chknotest0", "$chknotest1", "$chknotest2");
print_r($chknotest);
if (empty($chknotest))
print_r($chknotest);
else echo "not empty";