Lab Assignment 12: SQLite
Student Learning Objectives
- Design and implement using interactive PHP/Web application that uses
- XHTML Forms to get user input
- SQLite database with one table to store user information
- JavaScript to help with simple client-side error checking
- Server-side PHP scripting to duplicate client-side error checking and to run queries on a database
- Use comments, meta tags, and Tidy within HTML-Kit to create XHTML and PHP code that conforms to the CS 350 Coding Standards
Assignment
Extend the work we did in class to create
- a
login.php page that allows users to enter their username and password.
- If the username/password is correct, send them to welcome.php page
- Provide a link on login.php page to register.php so new users can self-register for the Website
- a
register.php page that allows new users to self-register for the Website
- Once entered successfully into the SQLite database, return them to the login.php page to allow them to login
- a "
welcome.php" page to send users to once they successfully log in
- Provide a link on welcome.php to send them back to login.php
- On the welcome.php page, display the user's username, password, email, and birth place
- Other supporting php files (e.g. authenticate.php) to create, access, and update the SQLite database
Save your files in folder u:\htdocs\lab12 in your cs350 account.
- To help with grading, begin your pages with your account number (e.g. in cs35002_nn [h1]) and your own name [h2]
- Create a test user with the username of
ed, the password of secret, the email of gellenbe@cwu.edu, and the answer to the secret question of ellensburg
- Allow new users to self-register for the Web site by entering their user information
- Require that they enter a unique username (required)
- Require them to enter their desired password and also to re-type their password to avoid typing errors.
- Error-check that the two passwords match (use both client-side and server-side error checking)
- Require an email address
- Require an answer to the secret question: "Where were you born?"
- Provide error checking on the input data and save the new user profile in the database only if all the required fields are complete and the username is unique
To Receive Credit
- Print out and staple together three printouts:
- your
login.php form page as displayed in a browser with an authenticated user's username and password entered
- Your
welcome.php page as displayed in a browser with the username, password, email, birthpace displayed
- your new user
registration.php page as displayed in a browser
- your other files will be checked online
- Save your files in folder
u:\htdocs\lab12 in your cs350 account.
Grading Criteria
- Labs will be graded on a scale of 0 to 10:
- 10: Excellent: no problems detected in the code, existing users can log in, new users can self-register, authenticated users' data displayed on the welcome page, and error-checking is performed.
- 9: Very well done: login and registration are both working but error checking is not complete
- 8: Well done: either login or self-registration has minor problems
- 7: Acceptable: Problems are present in the pages but a minimum level of functionality is present
- 6: Problems - nothing really works correctly but it is close to working
- 5, 4, 3: Incomplete: the lab was attempted but over one-third of the requirements still undone
- 0: Lab not submitted, no work done. You are allowed to drop your lab lowest score
Screen Snapshots
None provided, use your own design