Hw2: Login Script


The purpose of this exercise is to give you familiarity with setting up a three-tier web application--that is, an app that runs in the browser and interacts with a database on the server side.

Work through the tutorial PHP Login Script Tutorial or Php Simple Login Tutorial. And here's another that Trishan likes: [http://www.wikihow.com/Create-a-Basic-Login-Script-in-PHP Wiki HowTO].

Create a MySQL database for this exercise that contains a users table with fields for username (VARCHAR), password (VARCHAR with MD5 hasing), and last_login (TIMESTAMP). Populate the users table with some fake data.

Create a simple HTML login form with fields for the username and password and a 'Login' button, such that when the login button is clicked, the user's data will be sent to the server and validated against the already created users table, sending back a page that reports "Hello . Welcome to the system".

Handin Instructions

Post your solutions here, by editing this page, creating an internal link to your solution, and then pasting your solution into the page created for the link. To preserve formatting of your program, embed your source code between <pre>...</pre> tags.

The link should be named with the names of the members of the programming team. NOTE: Do not upload your solution until noon on the due date. We will look at the solutions in class.