4 include('libs/db.php');
6 * Let's use an array as the list of tunables.
7 * Put in a variable the inclusion of this file:
8 * $config_var = include('config.php');
10 $configs = include('config.php');
13 * [session_start start a unique session for the current browser client]
22 * [valid_page validate if the current page is a valid site actions]
23 * @param [string] $page [the viewed page name]
24 * @return [string] [the valid matching action or the default action
25 * if the action name do not exist ]
27 function valid_page($page_name)
31 foreach ($configs['actions'] as $action) {
32 if ($page_name === $action) {
34 // The actions list can't have duplicated entries
37 return $configs['actions'][0];
42 function display_action($action_name)
46 foreach ($configs['actions'] as $action) {
47 if ($action_name === $action) {
48 include("$action.php");
51 echo "Action to display do not exist";
56 display_action(valid_page($page));
60 require('footer.html');