les09 login page tm





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 tm
les09 cre ui tm
les09 disp?pt tm
les09 create? logic tm
les09 crectl logic tm
les09 credb connect tm
les09 get?pt tm
les09 get emp tm
les09 cregen query tm
les09 disp emp tm
les09 page handling tm
les09 create? conn prop tm
les09 getstart tm
page$

więcej podobnych podstron