It gives me this error when I try to load the page: Notice: Undefined variable: row in C:\wamp\www\vitamin-k-tracker\testing-form-checkboxes.php on line 3
I figure there’s some error in $_POST[ $row[“id”] ] because it’s so basic.
<?php
if (isset($_POST[ $row["id"] ]) && !empty($_POST[ $row["id"] ])){
print_r($_POST);
}
?>
<form action="testing-form-checkboxes.php" method="POST">
<?php $row["id"]= 'a'; ?>
<input type="checkbox" name="<?php echo $row["id"]; ?>" value="aa" />
<br /><br />
<input type="submit" value="Add Food to my Meal Planner Queue">
</form>
You are looking for
$_POST[ $row["id"] ]before you define it. Move<?php $row["id"]= 'a'; ?>to line 1.