Create a new top level directory

Assignment Help Basic Computer Science
Reference no: EM13936134

In Assignment One, you set up the basic design of the site, now you must expand the functionality of the site by adding SERVER-side PHP scripts. Design All new pages created for this assignment must conform to the design criterion established for Assignment One. All the pages you created in Assignment One should also be present in Assignment Two-not just the new pages or modified pages.

Required Tasks and Elements Assignment 1 Concepts Marks will be deducted for failure to adhere to the concepts already marked in Assignment One. E.g., Pay attention to your PHP coding style, e.g., your code should: Be simple and elegant, Be documented, e.g., comments at top of each document and on major sections, Use appropriate variable/types names, Use an appropriate layout, e.g., consistent indentation and use of white space. Appropriately structured, modular, reusable etc. Pay attention to the coding style of any new, modified or "PHP generated" XHTML or CSS (as detailed in Assignment One).

All new pages created for this assignment, and that includes dynamic pages created by PHP scripts must be in the same design style as all the pages in Assignment One This assignment must work when viewed using the Firefox browser or the Debian/Linux Firefox clone-Iceweasel. Your PHP scripts must work using the supplied version of PHP-the supplied version of PHP does not have any extra modules compiled in-it is the vanilla PHP with the calendar module only.

All URLs must work and be relative. Use CSS not XHTML attributes for presentation and style. All pages produced should be valid XHTML. Data Directory Data is going to be collected from users, some of it very sensitive and will require protecting. For ease of coding and marking create a new top level directory called data that will contain all the data files created and be used by the scripts of this assignment. Catalogue Pages From Assignment 1 you should have your site's catalogue spread over at least two pages with a link or entrance page to the catalogue. Modify the existing Catalogue pages using the XHTML Form element so that a visitor to the Catalogue pages can: Select items in the catalogue for purchase.

Each item that can be purchased has to be selectable with a quantity. That is, the number of seed packets the visitor wishes to purchase. After the customer has selected the items he or she wishes to purchase (with quantities for each item) there should be a Continue button on the page so that the customer's selections can be sent to the SERVER. Write a PHP "Order" script to do the following- Accept the input from the Catalogue forms. Check whether a cookie containing previous selections has been sent by the client Combine the selections in the cookie with the new selections from the form Return an XHTML page to display the total of the user's selections (those in the cookie plus the new selections from the form). Have the total cost of the purchases at the bottom of the page. This must be a well structured XHTML page. The returned XHTML page should also modify the cookie (or create it if it does not exist) so it contains all the user's selections to date The returned XHTML page should have two buttons on the bottom "Continue" and "Check Out". The "Continue" button takes the user back to the catalogue pages. The "Check Out" button calls the Check-Out script.

The Order script must perform input error checking! It must check input data is valid, cookie data is valid, cookie is valid! The POST method should be used to send the data to the Order script. Use only one script Check-Out Script The Check-Out script should be called if the ``submitting orders'' link of Assignment 1 is selected. When the Check-Out script is called the first thing it should do is read the cookie containing the complete order and validate the cookie data.

If the cookie does not exist (or something is wrong with the cookie data) it will return a page requesting the user first visit the catalogue and make some selections first. There should be a link back to the catalogue pages. If the cookie exists and is valid its contents will be displayed with the total cost of the purchases and added to the page will be a Form requesting shipping address and Credit Card information. The information requested will be- Shipping Information: Name Street Address City Postcode State Payment Information: Credit Card Type Credit Card Number Name on Credit Card Expiry date of the Credit Card (month and year) Card Security Code Use the appropriate XHTML INPUT types. The TEXT input type is not the most appropriate type in all cases. The POST method should be used to send the data to the script. Input error checking must be done by the script (for example, required fields must be filled in.

But do not worry about validating the CREDIT CARD number- to do that you would have to calculate the valid checksum using the Luhn Algorithm-Please don't do this as the marker will be required to enter a valid credit-card number!) When a Purchase has been accepted the Check-Out script will create a unique text file containing the purchase information in the directory data/purchase (see the notes section below). When a Purchase has been accepted the Check-Out script will create a unique text file containing the credit-card information in the directory data/payment (see the notes section below).

Link the two files-the purchase file and payment file by placing the other filename in each text file. That way you know which payment file is linked to which order file When a Purchase has been accepted the Check-Out script will reply with a thank-you page. The cookie on the client machine should also be erased! Use only one script Protecting Sensitive Information The information stored after a successful purchase should be protected from unauthorised downloads. Protect the directory purchase by configuring your SERVER so that only valid users have access to the purchase directory.

Protect the directory payment by configuring your SERVER so that only users in the admin group have access to the payment directory. Create a password file called password and group file called group, containing the following - Username Password Group user1 one admin user2 two The password and group files must be placed in the data directory. These files and any other sensitive files must also be protected by configuring the server so that no-one can download them! Assignment help Section In the help directory document this assignment and include links to the source of ALL your PHP scripts, configuration files &c. Documentation Explain the purpose of the PHP procedures that you have written. Include links in your help documentation to all (non-XHTML) source code files, e.g., PHP, CSS. Error Checking Your scripts should check all input for validity.

Your scripts should escape all input to eliminate any possibility of Cross-Site Scripting. List your checks in the help documentation. Marking Scheme: Order (one script) 30 Check-Out (one script) 35 Script Error Checking 15 Protecting Data 10 Design of new pages 10 Total 100 Notes: Reread the Notes from Assignment One. All new pages created for this assignment, and that includes dynamic pages created by scripts must be in the same design style as all the pages in Assignment One Scripts are to be written in PHP. No other language will be accepted- as learning PHP is part of the course.

Study the example scripts supplied with the SERVER and that can be found in the practicals. Each script must perform multiple tasks-write each task as a separate procedure this way the functionality of the script can be built-up incrementally and debugging is easier. Reuse code. There are a number of functions that are repeated in both scripts (display the contents of the cookie) use the same code.

The following function is an example of a simple way to create a unique filename in a directory # # usage # $filename = uniquefn("cc","payment"); # will create the files: # payment/cc001 # payment/cc002 # ... # relative to the script's location. # function uniquefn($prefix="tmpfile", $dir=".") { $max_files = 999; if( ! is_dir($dir) ) { return NULL; } $count = 1; do { $filename = sprintf("%s/%s_%03u","$dir","$prefix",$count); $count++; if( $count > $max_files ) { return NULL; } } while( file_exists("$filename") ); return $filename; } Do Not use global configuration directives as the directives will Not be submitted with the assignment. Directory configuration files should be used in the directories that require them. Some of the file configuration directives in directory configuration files must be absolute. For example, the path to a password or group file.

This is the only place where absolute pathnames should ever be used. These absolute paths will be modified by the marker before marking your assignment. The password and group files must be in the document tree so that it they are submitted with your assignment. Please note that on a commercial site a password or group file would NEVER be placed in the document tree.

Reference no: EM13936134

Questions Cloud

What is the total profit or loss to the strangle buyer : If the spot price of the dollar at option expiration is £0.63, what is the total profit or loss to the strangle buyer? If the spot price of the dollar at option expiration is £0.51, what is the total profit or loss to the strangle writer?
Current debate in marketing and brand management : Select a current debate in marketing and brand management. • Search the Internet and University of Roehampton Library and identify a relevant article about the current debate you selected.
Construct a contingency graph for a long pound straddle : Construct a contingency graph for a long pound straddle. Construct a contingency graph for a short pound straddle.
Design and implement a stringed musical instrument class : Design and implement a Java program that will gather integer numbers and performs some computations on the data entered. The program should use separate methods for inputting the data, calculating the sum, calculating the average, calculating the ..
Create a new top level directory : In Assignment One, you set up the basic design of the site, now you must expand the functionality of the site by adding SERVER-side PHP scripts. Design All new pages created for this assignment must conform to the design criterion established for ..
What is the maximum possible gain the writer of a strangle : What is the maximum possible loss the purchaser of a strangle can achieve using these options? What is the maximum possible gain the writer of a strangle can incur? Locate the breakeven point(s) of the strangle.
Integrated marketing communication issues : A brief discussion of the Integrated Marketing Communication issues which impact on competitiveness. These issues should be discussed from an implementation point of view.
How listening skills impact and are critical to a client : In addition to your interview, use your textbook, the Argosy University online library resources, and the Internet to conduct research on how listening skills impact and are critical to a client-patient relationship
Constitutes an issue of human dignity : You will first need to explain why this case constitutes an issue of human dignity. You will then need to discuss one perspective that is presented in the case study and analyze this in terms of the understanding of human dignity that underpins the p..

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Strategic advantages voip brings to businesses

Write down some of the strategic advantages the VoIP brings to businesses that adopt it? Prior, voice and data networks were separate and typically maintained by separate groups.

  Make a client server program with tcp (sockstream) socket

Make a Client Server program with following requirements : The server will create a TCP (sockstream) socket. The server will listen on the port 9999.

  Design a class named fan to represent a fan

Design a class named Fan to represent a fan. The class contains: * Three constants named SLOW, MEDIUM, and FAST with values 1, 2, and 3 to denote fan speed.

  Write a java program which defines unconstrained array

Write a Java program which defines unconstrained array of user defined length n (the value of n is to be taken from a proper user's input). Fill in the array with n random numbers.

  Design a superclass called shape

Design a superclass called Shape

  Create a budget and chart analysis for a fictitious business

For this assignment, you will create a budget and chart analysis for a fictitious business. Its purpose is for you to learn best practices for utilizing spreadsheet software (e.g., Excel, Google Spreadsheets, etc.). The final product will consist ..

  Describe the available materials and services

Describe the available materials and services

  Create the following for bet charts

The Banking e-Teller system allows bank customers to perform ATM transactions from their cell or smart phones. BET will allow customers to check balances, make remote photo capture check deposits, and perform balance transfers to their checking or..

  Compute the average grades

Prepare a program that allows a teacher to compute the average grades for EACH student in his or her class

  Report on explaining how to recover corrupt file

When you try to open the file in an image viewer, a message is displayed indicating that the file is corrupt. Write a 2-3 page report explaining how to recover the file, orkty.zip, for further investigation.

  Open source licenses

Open source licenses are licenses that comply with the Open Source Definition; in short, they allow software to be freely used, modified, and shared. To be approved by the Open Source Initiative (also known as the OSI), a license must go through the ..

  Can a language have no reserved words

Can a language have no reserved words? That is, suppose every reserved word (such as if and for) were merely predefined identifier. Can such a language exist? Explain.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd