<?php
if ($page == null || $page == "home")
require_once ("home.php");
else if ($page == "bill")
require_once ("bill.php");
else if ($page == "product")
require_once ("product.php");
else if ($page == "addproduct")
require_once ("addproduct.php");
else if ($page == "editpd")
require_once ("editpd.php");
/** ... MANY LINES ... **/
else if ($page == "permission")
require_once ("permission.php");
else if ($page == "options")
require_once ("option.php");
else // NOT FOUND, REDIRECT HOME
echo "SOMETHING WENT WRONG";
?>
The above code is loads of IF ELSE and REQUIRE_ONCE
.
I have started worrying about the execution time when the system is developed, it means that i have to write IF ELSE and REQUIRE_ONCE
more and more.
So i really want to know,
What is a solution or the better way for this in case not use any framework?