Authentication

PHP Mechanisms

Lecture Code

The code below allows a user to login to a very simple application. Once the user is logged in, she can either change her password or signout. The code illustrates some very simple security precautions.

Preliminaries

The code below assumes that a database named authentication is set up that contains a table named accounts. The accounts table has a username field of type varchar(50) and a password field of type char (40). The username is the primary key of the table.

HTML File

Include Files

PHP Files

Secure Sockets Layer Protocol


Laboratory

Do something interesting and non-trivial that involves authentication. If you are a Montana State student, demonstrate it during today's lab period. If you are a University of Leipzig student, either demonstrate it during today's lab period or e-mail it to Sebastian (loewe AT uni-leipzig.de) no later than the end of the day.

Valid XHTML 1.0!