Project Overview

The purpose of this project is to build on what we did in PHP Project #1. Now that everyone has some idea of server-side coding, we are going to start interacting with the front-end via AJAX coding. We will also learn how to store, retrieve, and manipulate data in a database (MySQL). At this point, concepts about file structure, organization, and planning become extremely important.

As with the first three projects, this forth project is meant to be expanded upon later. In the fifth project, we will start building actual tools and functionality that you would find on real-world websites.

Example Site #4

File Structure

  • Create a new folder for this forth project (this should be a separate folder from Project #1, Project #2 and Project #3)
  • Copy everything from your third project folder into this new folder
  • Under the "subpages" subfolder:
    • Create a new text file called "contact-database.php"

Database

Requirements:

  • Log into the server using phpMyAdmin
  • Create a new table called "ContactTable"
  • Create a field called "Name"
  • Create a field called "Email"
  • Create a field called "Message"
  • (all fields should be type VARCHAR 255)

contact-database.php

Requirements:

  • Store the server, username, password, and database
  • Create a connection to the database server

contact-process.php

Requirements:

  • Instead of saving the contact form results to a text file, save the information into the database
  • Use the connection created in contact-database.php to communicate with the MySQL server (do not perform the connection to the server from this file)
  • Check that the email address does not already exists on the ContactTable before adding it

Grading

Unsatisfactory

You will receive a failing grade. You will have to redo parts of your project to bring it up to standard.

 

  • Work not submitted
  • Work submitted after deadline
  • Work not complete (missing any of the above requirements)
  • A site that does not work (broken CSS link, broken jQuery code, non-functional PHP data not saving properly into the database, etc.)

Pass

You will receive a 60% - 75% depending on the number of mistakes you have in your code.

 

  • PHP does not work properly
  • Data saves into the database but has formatting issues
  • JavaScript issues (field validation before submitting form data)
  • Connection to server is made in contact-process.php (this is not the correct way of connecting to the database)

Complete

You will receive 75% and up depending on how clean your code is and how nice your site looks.

 

  • All jQuery and PHP is working as expected
  • PHP detects duplicate emails
  • Use PHP to replace duplicate HTML code
  • ContactTable contains records in correct format
  • contact-process.php is able to detect, reject and return an error for duplicate emails
  • Store your content in a database table and retrieve it when loading your content pages

Deadline / Submission

Due Date: March 28th, 2016

Late submissions will be penalized 2% per day late

 

Process

  • Compress your project folder into a single .zip file
  • Name the .zip file [last name].[first name].webdev.04
  • Submit .zip file via Edmodo