I've a table being populated with courses. Each row
represents a different course and each row
has a register
button which when clicked will register the user to that course
.
My problem is this...How can I detect which button
is pressed in the table and perform the relevant actions using PHP
?
This is my code:
<form action="#" method="POST">
<table>
<tr>
<th>Date</th>
<th>Venue</th>
<th></th>
</tr>
<? while(have_rows('location')): the_row(); ?>
<tr>
<td> <?= date("d-m-Y", strtotime(get_sub_field('date'))) ?></td>
<td><? the_sub_field('venue') ?></td>
<td><input type='submit' value="Register" class="register"</td>
</tr>
<? endwhile ?>
</table>
</form>
At the moment I assume when I click the register button it will send all of the rows of the table
to the script. I would like to send one depending on which register button
was clicked.