CS2623: Server-Side Programming
SSP05: Dynamic Content
Objective:
- Utilize include files
- Display dynamic content
- Use URL tokens
Points
- Full Credit: 40 Points
- Late/Resubmit Credit: 36 Points
Situation
It has been noticed that this week's assignment does not really match the content in Chapter 4.
This is weird to me also, but we will just go with it.
The mateiral covered in Chapter 4 will be used in future assignments and will still be on the test. So be sure to study it.
In this assignment, new web pages will be created. This is the point where the web pages become linked and data is displayed dynamically.
Need a Visual Reference?
View the following video on YouTube of past student sites. In most of the cases the entire web page is not included in the screen shot, just enough to let you see the functionality of each project assignment. These videos are in a restricted area and intended for use only by students in this class.
Disclaimer: If you see something that is contradictory to our class assignments, please ask. Do not assume that since it is on the video that it is 100% correct.
Dynamic Content 1-3 uses the files as indicated in the text not the buttons and links which will be modified for our class. Be sure to check the status area at the bottom of the screen. This will probably be the most beneficial part because it shows the links.
Discovery Content 4-5 displays the homepage content as well as the pages which display the place holders. Note the URLs at the top of the screen indicate all of the pages are being displayed inside of index.php. The homepage (PHP and Zodiac) will display content and the other pages will display the placeholders.
Note: Students may NOT copy the text from the sample for use in their site. Every student must write their own text. Copying this text and using it as your own will be considered plagiarism and handled accordingly.
Specifications
Important Concept - Be sure you understand what is happening and why. Failure to do so can almost guarantee frustration and headaches throughout the semester! This explanation enhances p. 230 and Discovery Projects 4-2, 4-3, and 4-4:
- As previously mentioned this web site will display the content of each internal link in the dynamic content area (inc_home.php) of the main index.php. This is different than most websites that have a separate page for each content item. To accomplish this
- Each internal link in the site must link to index.php and include a name/value pair.
- create a link to index.php instead of the individual pages as you are most probably most accustomed to doing. Example: <a href="index.php.......>
- create a variable to hold the identifier for the content to be displayed. In this example page will be the variable name. Example: <a href="index.php?page=.......>
- assign the variable a value indicating the content to be displayed. In this example site_layout will be the value assigned to the variable page. Example: <a href="index.php?page=site_layout">
- In index.php replace the script link with a link to inc_home.php(Discovery Project 2-2 and 2-3) with a switch statement. (it might be helpful to follow along with the Discovery 4-4 code)
- The switch statement will use the value passed in the $_GET array. In our example the value being passed in the in the page Example: switch($_GET['page'])
- The case statements will test for the value of the variable. In this example site_layout is being used Example: case 'site_layout':
- When a case condition is true, an include() statement will be executed designating the php code to be included. Example: include('includes/inc_site-layout.php');
- As the semester progresses the switch statement will become somewhat lengthy. It may also be a bit tricky at times so again be sure you understand the process.
In Discovery Project 4-1
- eight new files will be created as indicated in Table 4.3 on p. 229 with the following modifications.
- midterm_assesment, final_project, and user templates will not be created
- The three deleted items will be replaced by two new items
| Target Page |
Inlcude Filename |
Page Content |
| files |
inc_files.php |
[Insert files content here] |
| object_oriented |
inc_object_oriented.php |
[Insert object oriented content here] |
- Each page will consist of one line as indicated in the Page Content column. This can just be one line of HTML code.
- FYI:
- The Target Page column will be used in Project 4.2 and is not included in Project 4.1.
- In the text, control_structures is printed on two lines in the Target Page column. This is textbook printing issue. It should be control_structures - on one line.
Discovery Project 4-2 and Project 4-3
- References Discovery Project 2-2, I believe it should be Discovery Project 2-3
- Do NOT use inline styling as indicated in the text (style="border:0"). Rather add this to your CSS file and then use the class attribute with each button.
Discovery Projects 4-3 through 4-4
- References Discovery Project 2-2, I believe it should be 2-3
- Modify the switch statement to delete the case statements for user_templates, midterm_assessment, and final_project. Add case statements with appropriate coding for file and object_oriented.
Discovery Project 4-5.
- IMPORTANT: The books provides the code index.php?page=home_page§ion=PHP . However, this will not validate strict. Change the & to & and it should be fine. Example: index.php?page=home_page&section=PHP
Include files will not validate when viewed outside of the parent web page because they do not include DTD and basic XHTML tags. That is acceptable. However, when the are validated as part of the parent web page, they must not prevent the parent page from validating. The entire parent web page must validate for both XHTML and CSS.
Upload the new or modified files in the ChineseZodiac folder to Apollo1
Recurring Specifications:
- XHTML must validate STRICT on all pages (but not on individual include files)
- CSS must validate for CSS3 Standards
- Code must be easy to read and properly indented.
- Documentation must be appropriate and meaningful.
- Meta Tags including the following must be included on index.php. The content must be revised to information that is meaningful to the page.
<meta name="author"
content="Your Name" />
<meta name="revised" content="12/18/2015" />
<meta name="description" content="Description of web page" />
<meta name="keywords" content="Add appropriate key words" />
- Tables may not be used for general layout and only when specifically indicated in an assignment.
- JavaScript may not be used in assignments unless specifically indicated. One exception is the date late modified at the bottom of the web page.
Assignment Submission
- Follow the Assignment Submission requirements outlined in http://apollo.occc.edu/chyde/CS2623/Handouts/CS2623_CodingStandards.htm.
- Upload the files/folder to your apollo1 account.
- View the web page/s in Firefox, Chrome, Safari, and Internet Explorer.
- Revalidate and double check to make sure all items are visible from all computers.
Note: The files from Projects 4-1, 4-2, 4-2, and 4.5 will not validate because they do not have complete DTD's and tags. However, index.php when it is displaying ANY and ALL of the dynamic content must validate.
- Submit the URL of your web page in the LMS.
- The URL will be
- http://apollo1.occc.edu/user#####/ChineseZodiac/index.php
- Submission links must open web page in a new window (not inside of MoodleRooms) and display the page (and not a directory)
- XHTML code must validate STRICT and CSS must also validate for CSS3 or earlier. The Web Developer Toolbar in Firefox will be used for grading.
- Assignments not meeting the previous requirements (opening in a new window and XHTML/CSS Validation) cannot be graded. If it is still within the late/resubmit period, they can be re-uploaded and resubmitted (10% penalty). If it is after the final deadline, the work can no longer be submitted.