Assignment 5
Integrate dynamic content into a AwardSpace website using PHP5 and the MySQL database.
Required Knowledge & Skills
- account on AwardSpace
- setting up a MySQL database
- creating and populating tables in MySQL
- custom RGB colors and HTML styles
- HTML tables
- basic PHP5 scripting
Background
Dynamic content is key to realizing BoatVentures' needs for a modern websites. The team has been asked to add dynamic views of available yachts so that new yachts can be added without requiring pages to be edited by a programmers.
Part 1
- Watch this short tutorial on how to configure a MySQL database on AwardSpace.
- Create a MySQL database. You may use any password, but be sure to write it down so you can connect to the database later.
- Create one table called "boats" in your database and add the columns (attributes) "b_name" for boat name as VARCHAR with length 64, "b_desc" for boat description VARCHAR with length 2048, and "b_img" for a URL to the boat image VARCHAR with length 1024.
- Designate the "b_name" column as your table's primary key by clicking on the Primary Key link in the field description; this ensures that all boats are unique and there are no duplicates
Part 2
- Create a custom dynamic page in PHP5 on AwardSpace named viewBoats.php that displays the information in the database in the layout below. You can get this layout by making the name of the boat as an <h3> header followed by a two column table.
Hints
- Save your script before you run it or you will lose your work.
- Code a little then test.
- Use a table to lay out the content. Get the HTML to work first in an interactive editor then place the PHP code around it.
- Note that the text has a reduced size of 10pt (or 10px depending on how you specify the style) and a custom RGB color (#788287).
- You can use the URLs to the pictures in your current Yachts page as those pictures were uploaded to the site and will still be there. Alternatively, you can host them on AwardSpace or another image hosting site such as imgur.com.
- The headings should be <h3> headers with a color of "navy".
- One of your columns in the database must be designated as a primary key and that column cannot be larger than 1000 characters. Make the boat name your primary key and keep it to 64 characters; designate it as the primary key by clicking on the Primary Key link in the table editor
- Make sure there a semi-colon at the end of all line, except when there's a { after
- Be sure to close all strings
- To put a string within a string use single quote, e.g., echo "<img src='" . $row["b_img"] . " '> ";
Part 3 (Bonus: 5 Points)
For your website, use bootstrap components as much as possible. So, your website becomes responsive. Instead of using external css try to use different bootstrap classes.
Load your website on mobile to check if it became responsive or not. To see different examples of Bootstrap refer to this URL.
Resources Required & Notes
- AwardSpace account
What to Submit
- Clickable URL to the redesigned Yachts page that contains the PHP result (AwardSpace URL)
- Upload (attach) the source code of the PHP program that you wrote to Blackboard as part of your assignment submission; you can download your PHP program from AwardSpace by clicking the right mouse button on the file name in the AwardSpace File Manager and then selecting "Download"
Grading Rubric | Submission Instructions
Total Number of Earnable Points: 100 Points
Approximate Time to Complete: 2.5 Hours
Due Date: see Syllabus or Blackboard
Approximate Time to Complete: 2.5 Hours
Due Date: see Syllabus or Blackboard