I'm trying to use a function to produce a variable based upon a input, like this:
function checkers ($s) {
if ($_GET["Slot$s"] == "OC-192" ) {
echo ('
<label>
Port 0
<input type="checkbox" name="slt$s[]" value="0" />
</label>
<label>
Port 1
<input type="checkbox" name="slt$s[]" value="1" />
</label>
<label>
Port 2
<input type="checkbox" name="slt$s[]" value="2" />
</label>
<label>
Port 3
<input type="checkbox" name="slt$s[]" value="3" />
</label>
');
}
}
?>
I want the name of the checkboxes to change as $s changes. I know the code I have above will not work. Could anyone suggest any solutions to this?