I'm trying to pass in the value of the button to $_POST["class_name"]
so I can use it in selectclass.php
. I want to be able to click on the button in the table and have $_POST = the value of the button, or even better, if possible, the class_id next to the button. Any help would be really appreciated.
<tbody>
<form action="selectclass.php" method="post">
<?php foreach ($classes as $class): ?>
<tr>
<th><button type="text" name = "class_id"><?=$class["class_name"]?></button></th>
<th><?=$class["class_id"] ?></th>
</tr>
<?php endforeach ?>
</form>
</tbody>