The page will have two different functions depending on the button clicked and for no button clicked a message will be displayed. I did a var_dump($_POST) on the page if no button is clicked and i get this result:
Code: Select all
array(0) { }
Code: Select all
//
if (count($_POST) == 0) {
/*
default message if page is accessed directly
*/
}
else {
/*
check which button has been clicked.
*/
}
Is this a valid approach? There might be additional functions for this page in future so i want the code to be as flexible as possible.