top of page

Creating Web Form Using PHP, HTML and CSS | Sample Practice Set



Task

Westco Pools is a fictitious supplier of above-ground swimming pools. They sell swimming pool kits in various sizes as well as optional extra components. You are required to build:


  • a web page containing a form that lets potential customers enter their contact details, choose their swimming pool kit, and select the optional extra components they would like; and

  • a web page that calculates the total cost of the customer's swimming pool and displays the following details when the form is submitted: the customer's contact details, the selected swimming pool kit, any selected optional extra components, and the total cost.


The web pages must be implemented with PHP, HTML and CSS code. You must write all of the code yourself.


Creating the form page Create a web page named form.html that contains a form that lets potential customers enter their contact details, choose their swimming pool kit, and select the optional extra components they would like. The form must contain the following fields:


  • a text input box for the customer's first name;

  • a text input box for the customer's last name;

  • a text input box for the customer's phone number;

  • a group of radio buttons for the swimming pool kits labelled:

1. Small kit (3.6 metre diameter)

2. Medium kit (4.5 metre diameter)

3. Large kit (5.5. metre diameter)

4. Extra large kit (6.4 metre diameter)

  • a group of checkboxes for the optional extra components labelled:

1. Pool cover

2. Maintenance kit

3. Ladder

4. Slide

5. Heater

6. Filter and pump system

  • a submit button; and

  • a reset button

Clicking the submit button must pass the form input data to a web page named cost.php.


To simplify development and marking, the appearance of the page must closely resemble the example shown in Figure 2–1. Don't try to enhance the appearance of the page by adding extra elements to it. The border around the screenshot in Figure 2-1 is not part of the web page.


Form.html


Creating the results page

Create a web page named cost.php that calculates the total cost of the customer's swimming pool and displays the following details when the form is submitted:

  • the customer's first name;

  • the customer's last name;

  • the customer's phone number;

  • the selected swimming pool kit;

  • the selected optional extra components in an unordered list; and

  • the total cost.


To simplify development and marking, the appearance of the page must closely resemble the example shown in Figure 2–2. Don't try to enhance the appearance of the page by adding extra elements to it. The border around the screenshot in Figure 2-2 is not part of the web page.



If the potential customer does not select any optional extra components in the form, the results page should display the message 'You selected no extra components' instead of the list of extra components.


The total cost can be calculated by adding up the prices of the selected items. The prices are listed in Table 2-1.



If the potential customer does not supply a first name, last name, phone number or swimming pool kit on the form, the results page should tell the customer that the missing details are required and ask him or her to click the browser's Back button and try again. Processing of the form should stop at that point.



The following examples illustrate how the total cost is calculated.

Example 1. A potential customer wants a medium kit with no optional extra components. The total cost is $2,750.

Example 2. A potential customer wants a large kit with no optional extra components. The total cost is $2,950.

Example 3. A potential customer wants a large kit with a pool cover. The total cost is $3,020. $2,950 + $70 = $3,020

Example 4. A potential customer wants a large kit with a pool cover and a ladder. The total cost is $3,270. $2,950 + $70 + $250 = $3,270



Technical constraints

The following technical constraints apply to this assignment.

  • Your web pages must be constructed with PHP, HTML5 and CSS, not other technologies.

  • You are required to use CSS to control the appearance of the text in your web pages. Each web page should be linked to an external style sheet named styles.css.

  • Your web pages must not contain any images, audio clips, video clips or other elements that require browser plug-ins.

  • Your web pages must not contain any client-side scripts such as JavaScript code.

  • Your web pages should display correctly on the latest versions of Google Chrome and Mozilla Firefox on a PC.



You might Get Help In

  • PHP Assignment Help

  • PHP Programming Help

  • PHP Homework Help

  • PHP Project Help

  • PHP Coursework Help

  • PHP Web Application Help


Send your requirement details at realcode4you@gmail.com and get instant help with an affordable price.
122 views0 comments
bottom of page