I have multiple forms in multiple pages, I send them to the same page called handler that handles the form inputs, I currently have multiple if statements to check what form was submitted, how can I create a class in the handler page and make each form submit to a certain function in the class so it doesn't go through thee if statements looking for which form the user submits, here's how my current code looks like.
The forms:
<form action="handler.php" method="post">
// Form elements..
<button type="submit" name ="finishfirst" >finish first</button>
</form>
<form action="handler.php" method="post">
// Form elements..
<button type="submit" name ="finishsecond" >finish second</button>
</form>
// Another forms..
The handler page:
if (isset($_POST['finishfirst'])) {
// Irrelevant code..
}
if (isset($_POST['finishsecond'])) {
// Irrelevant code..
}
// Another if statements..