Guide to PHP and MySQL (University at Buffalo Version)


Chapter 16: Putting it all Together

What Makes a PHP Web Site

When I think of a well-designed user-friendly web site I think of features such as a signup/register page, login page, a forgot password link, good consistent navigation on each page, a page where the user can maintain their profile (add a photo, nickname etc.), an "About Us" page, a "Contact Us" form page, a nice response when the user submits the form to acknowledge that their data was received, friendly error messages, and front-end form data validation (using JavaScript) to notify the user of any errors or incorrect input as they fill out the forms. Optionally, depending on the reason for the web site, a blog page where registered users can make comments, an opportunity to subscribe/unsubscribe from the newsletter, a product catalog page and shopping cart (if it's an e-commerce site), the ability to add or remove items from their shopping cart, etc. The web site would have a database (MySQL) back-end to store the user login/profile information, the comment entries, shopping cart/catalog data, etc. The user profile would have a field designating whether that user is an administrator allowed to edit user/catalog/cart/comment data.

Navigation -> Home
              About Us
              Contact Us
              Login/Logout
              Newsletter            
              Register
If admin -> maintain users
            maintain comments
            maintain products
            maintain newsletters                          
  
Figure 16-1: Final Web Site Outline

Task - Create a PHP Web Site

For this task you will create a well-designed electronic system web site demonstrating your understanding of good design principles and appropriate PHP and MySQL usage. You may choose the type of system (retail, business-to-business, non-profit fund raising, auction, classified ads, etc.).

  1. This site should contain (at a minimum):
    1. a home page (about this site),
    2. a login page (reguires a back-end registraton system) with:
      1. a register page
      2. a forgot password page
    3. a database-driven table page (inventory or classified offerings for example),
    4. back-end catalog and user maintenance systems accessible only by a user designated as an 'admin',
    5. a page displaying an order form along with an appropriate "success/thanks" page,
    6. a back-end set of tables to store shopping cart and orders information,
    7. a "Welcome Back" page that displays a user's orders and shopping cart (if one exists) after the user logs in,
    8. a final "Contact Us" form page.
  2. Use well-designed navigation so that the user can get to any page from any other page in this site. You may want to create a separate nav.php file and use the php_include_once to use the same navigation throughout the site.
  3. Modify your JavaScript in your index.php file that uses an array of the Assignments for this course to display an ordered list of these assignments to convert the entry for this assignment to a web link that allows me download and save your web site pages and your, nav.php, vars.php, functions.php, functions.js , and any other files so I can download, save, and grade your work.

You will modify the PHP function for this item in your index.php page to add a link to your web site files that allows me to view your work.

You *MUST* use the W3C Unicorn Validator to validate your HTML5/CSS3 code.

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Copyright © 2016-2018 Jim Gerland