Guest User

Untitled

a guest
Apr 26th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. Task 2
  2.  
  3. Now that we have a database we have to understand the tables inside it. Each of your databases contain a single table named: persons
  4.  
  5. The ‘persons’ table has the following columns.
  6.  
  7. • PersionId, INT, Primary Key, NOT NULL, AUTO INCREMENT
  8. • FirstName, VARCHAR(50), NULL
  9. • LastName, VARCHAR(50), NULL
  10. • EmailAddress, VARCHAR(255), NULL
  11. • TelephoneNumber, VARCHAR(20), NULL
  12. • SocialInsuranceNumber, VARCHAR(11), NULL
  13. • Password, VARCHAR(50), NULL
  14.  
  15. NOTE: you can use the SQL command ‘DESCRIBE persons’ for more information about your table.
  16. Task 3
  17.  
  18. Use techniques learned in ‘Common Look and Feel’ to develop the following web site. Your web site MUST use ‘Design Pattern 4’. Your web site will include the following PHP scripts:
  19.  
  20. • Header.php
  21. • Footer.php
  22. • Menu.php
  23. • CreateAccount.php
  24. • Login.php
  25. • ViewAllAccounts.php
  26.  
  27. NOTE: CreateAccount.php, Login.php and ViewAllAccounts.php, all must include the Common look and feel implemented in Header.php, Footer.php and Menu.php.
  28.  
  29. Header.php
  30.  
  31. Header.php must contain a script to display a Common Header that will appear on every page. The header must contain: Name, Student Number, Lab Number and Lab Title
  32.  
  33.  
  34. Footer.php
  35.  
  36. Footer.php must contain a script to display a Common Footer that will appear on every page. The footer must contain the Lab Number and Lab Title
  37.  
  38.  
  39. Menu.php
  40.  
  41. Menu.php must contain a script to display a Common Menu to be show on every page. The menu must contain links to CreateAccount.php, Login.php and ViewAllAccounts.php
  42.  
  43.  
  44. CreateAccount.php
  45.  
  46. Create a PHP form that will create user accounts in the Persons table of your database.
  47.  
  48. Details:
  49. 1. Use ‘input’ tags to accept the information listed in Task 2. Your form must populate all the columns of the ‘persons’ table.
  50. 2. After the information has been submitted to the database save each of the values from the form in the Session State.
  51. 3. Once the user data is stored in the Session, automatically redirect the user to ‘ViewAllAccounts.php’
  52.  
  53. NOTE: PersonId is listed as ‘AUTO INCREMENT’ meaning that the database will automatically populate this field.
  54.  
  55. NOTE: Session_StoreValues.php has an example of programmatically sending a user to another page in your website.
  56.  
  57.  
  58. Login.php
  59.  
  60. The form Login.php allows the user to log into your application.
  61.  
  62. Details:
  63. 1. Create a form to accept the users EmailAddress and Password as credentials to your site. Use an SQL Query to determine if the person has an account.
  64. 2. If the user has an account, store ALL of their personal information in the Session State and then redirect the user to ‘ViewAllAccounts.php’. Display an error if the user cannot log into the system.
  65. 3. The page must also contain a link to ‘CreateAccount.php’ so that a client can create an account if they do not have one.
  66.  
  67.  
  68. ViewAllAccounts.php
  69.  
  70. This page pulls information from both the Session and Database and displays the information to the user.
  71.  
  72. Details:
  73.  
  74. 1. If the user tries navigate to this page without having logged in – the user should be redirected to the login page.
  75. 2. If the user has successfully logged into the application and is directed to the page display the following information
  76. a. Divide the content of page into 2 sections (One on top of the other)
  77. b. The top section of the page will display all the user details stored in the Session State
  78. c. The bottom section of the page will display a HTML table containing of the person rows in the persons table of your database. Each column in the HTML table must a column in the table. The HTML table must also contain a header row that identifies the column name of the database table.
  79. d. Provide H1 HTML headers so that both sections (instructions B and C) are clearly marked
  80.  
  81. NOTE: To verify is a user has successfully logged into check for valid information in the Session State. If the Session State does not contain valid information redirect to the login page, otherwise, the user has logged in successfully.
  82.  
  83. NOTE: The Blackboard file ‘PHP, MySQL CRUD Example.zip’ contains a detailed example of the things you are expected to do in this lab.
Add Comment
Please, Sign In to add comment