I'm developing a web application for my work. It consists of a dashboard that will present company information to the managers. In this context, I'm trying to optimize the page by searching for the appropriate content according to the mode I'm looking for. Thus, I made a menu containing the three types of teaching that the company works: college, undergraduate and graduate. I was making the menu buttons like forms that would redirect to a page that would have a function that verifies the mode sent via POST. It's functional, yet whenever I try to go to another page it accuses form data can get lost and becomes an uncomfortable thing. In this way, I would like tips and suggestions on how to re-do to get to the end result I want without having this form message.
Function that returns page
function get_page_modalidade($modalidade = "home"){
if($modalidade == COLEGIO){
return print "include './parts/menu-detalhe.php'" ;
} elseif ($modalidade == "home") {
return print "include './parts/menu-detalhe.php'" ;
} elseif ($modalidade == GRAD) {
return print "include './parts/menu-detalhe.php'" ;
} elseif ($modalidade == POS) {
return print "include './parts/menu-detalhe.php'" ;
} else{
return "outro";
}
}
Function call
<?php get_page_modalidade($_POST['modalidade']);?>
Menu button
<li>
<form action="index.php" method="post">
<input type="hidden" name="modalidade" value="home">
<input type="submit" name="home" value="Dashboard" class="btn-block btn btn-focus btn-menu">
</form>