Logging In
The interactions in this eCourse require Javascript to be enabled.
Logging In
previous|next
The do_login() function generates the login page. The function detects if the username and password are posted as form parameters. If not, then it displays the login form.
When the login form is submitted, hr.php is requested again. However, the application state will ensure that do_login() is invoked again with the username and password supplied. In this case, do_login() uses the db_connect() database function to authenticate the username and password as valid.
If the username and password are valid, the do_login() function does the following:
Sets the loggedin session variable to indicate that the user has started an application session
Stores the username and password as session state for subsequent database access requests
Uses the PHP header() function to redirect to the hr.php page without parameters causing the department information to be displayed
Note: The login code is simplified for the purposes of this tutorial. Ideally, you would use a single transparent database login and query a database table to authenticate HTTP session login requests.
Wyszukiwarka
Podobne podstrony:
les09 logout page tmles09 cre ui tmles09 disp?pt tmles09 create? logic tmles09 crectl logic tmles09 credb connect tmles09 get?pt tmles09 get emp tmles09 cregen query tmles09 disp emp tmles09 page handling tmles09 create? conn prop tmles09 getstart tmpage$więcej podobnych podstron