2829b2676d9a720de486008b50984ba1f355fb97
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]
17 //$page = filter_input(INPUT_GET, $_GET['page'], FILTER_SANITIZE_URL);
18 $page = $_GET['page'];
25 * [valid_page validate if the current page is a valid site actions]
26 * @param [string] $page [the viewed page name]
27 * @return [string] [the valid matching action or the default action
28 * if the action name do not exist ]
30 function valid_page($page_name)
34 foreach ($configs['actions'] as $action) {
35 if (strcmp($page_name, $action) === 0) {
36 // The actions list can't have duplicated entries
40 // Return the default action
41 return $configs['actions'][0];
44 function display_action($action_name)
48 $found_action = false;
49 foreach ($configs['actions'] as $action) {
50 if (strcmp($action_name, $action) === 0) {
51 include("$action.php");
57 echo "Action to display do not exist";
61 $action = valid_page($page);
62 display_action($action);
66 require('footer.html');