Handling Requests |
||||||||
The request handling logic depends on an HTTP request parameter, called do, whose value is used to determine the next page to be displayed. When a user first requests the hr.php page, the do HTTP parameter is not provided. Because the user has not logged in, the loggedin session parameter is not set. Therefore, the request handler calls the do_login() function to display the login page. Here is the page-handling logic: if (!isset($_REQUEST['do']) && !ui_islogged_in()) { do_login(); } else { $doreq = isset($_REQUEST['do']) ? $_REQUEST['do'] : "showdept"; if ($doreq == "logout") { do_logout(); } elseif ($doreq == "showemp") { construct_employees(); } else { construct_departments(); } } After the user has successfully logged in, an HTTP request without the do parameter causes the department information to be displayed. Otherwise, when the do HTTP parameter is:
|