Question

Write a program using the PHP application that will create a form for your favorite store....

Write a program using the PHP application that will create a form for your favorite store. The form should include fields for contact information and at least three(3) items to order from. It should calculate the order and display a subtotal before tax and a total after tax. Also add background color and pictures
0 0
Add a comment Improve this question Transcribed image text
Answer #1

The html File:

<!DOCTYPE html>
<html>
<head>
<style>
div {
background-image: url('img_girl.jpg');    
}
body {
background-color: red;
}
</style>
   <title>Favorite Store</title>
  
   </head>
   <body>
   <form action="index.php" method='get'>
   <h2>Select Item for Purchase:</h2>
<input type="checkbox" name="choice[]" value= "1"/>T-Shirt ,Price: 10 USD<br/>
<input type="checkbox" name="choice[]" value= "2"/>Sweater ,Price: 20 USD<br/>
<input type="checkbox" name="choice[]" value= "3"/>Jeans ,Price: 30 USD<br/>
<input type="submit" value="Order">
</form>

</body>

</html>

index.php file code.

<!DOCTYPE html>
<html>
<head>

</head>

<body>

<?php
if(isset($_GET[choices])){
$clothes=4_GET["choices"];
$c= count($clothes);
$price=0.0;
$taxRate=20;
$tax=$price*$taxRate/100;
$totalprice=$price+$tax;

for($i=0;$i<$c;$i++){
if($clothes[$1]==1){
$price=$price + 10
echo"you have selected T-shirt<br>";
}
if($clothes[$1]==2){
$price=$price + 20
echo"you have selected Sweater<br>";
}
if($clothes[$1]==3){
$price=$price + 30
echo"you have selected Jeans<br>";
}
}
echo " subtotal before tax is: " .$price. "<br>";
echo " Total Price with tax is : " .$totalprice. "<br>;
}
else{
echo" Please select an item to purchase!";
}

?>
</body>
</html>

Add a comment
Know the answer?
Add Answer to:
Write a program using the PHP application that will create a form for your favorite store....
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a PHP language that contains a form with you favorite place to buy clothes ....

    Create a PHP language that contains a form with you favorite place to buy clothes . Also calculate your before and after tax of those items .

  • 2. Write a PHP program that will display a form containing two fields: username and password,...

    2. Write a PHP program that will display a form containing two fields: username and password, a submit button. Upon submission of the form, check the validity of the username and password. Display a welcome message if the username and password is valid else displays any error message. [3 Marks] e hp

  • Create a php program that contains a multi-dimensional array called package. package contains the following arrays:...

    Create a php program that contains a multi-dimensional array called package. package contains the following arrays: colors; which has the values of at least 4 colors sizes; which has the values of at least 4 sizes locations; which has the values of at least 4 locations transport; which has the values of at least 4 types of transport The program should display a random sentence containing one value of, size, color, locations and transport. this is for web 2- php...

  • Develop an application in C#, which stores and manages your favorite web bookmarks. In this application...

    Develop an application in C#, which stores and manages your favorite web bookmarks. In this application the user should be able to display the list of all current bookmarks, as well as add, edit, or remove bookmarks from the list. Each bookmark consists of its title, URL address and, description. The list of bookmarks should be saved in secondary storage, in order not to be lost after the application is closed . Therefore, each time it is started, the application...

  • In Java. Write a GUI contact list application. The program should allow you to input names...

    In Java. Write a GUI contact list application. The program should allow you to input names and phone numbers. You should also be able to input a name and have it display the previously entered phone number. The GUI should look something like the following, although you are welcome to format it in any way that works. This should be a GUI application with a JFrame. The program should contain two arrays of Strings. One array will contain a list...

  • C# question In this project, you will create your own on-line shopping store in the console...

    C# question In this project, you will create your own on-line shopping store in the console application. You can choose different products to sell in your store (at least 8 products). You will create an product inventory text file. The program will display two options at the beginning of the program, Customer and Manager. Customer: If this is a new customer, the program will let customer to register with their information and assign a unique ID number to the new...

  • PYTHON Programming Exercise 2: Create a Simple Cost Calculator Write a program that displays input fields...

    PYTHON Programming Exercise 2: Create a Simple Cost Calculator Write a program that displays input fields (item name and cost) and calculates and displays the calculated costs. The program should do the following: Provide data entry areas for item name and cost. Calculate and display the subtotal of all items. Adds a sales tax of 6% and calculate and displays the total cost. Enter the following values into your program. Mother Board $200. RAM $75. Hard Drive $72. Video Graphics...

  • Question 1 CSEB113 Write a program to create customer's bll for an electrical appliance company. Assume...

    Question 1 CSEB113 Write a program to create customer's bll for an electrical appliance company. Assume the company sells only three different products: TV, VCR and CD player. The unit prices are RM3000, RM500 and RM300 respectively. The program must read the quantity of each piece of the items purchased from the user. It then calculates the cost of each item, the subtotal and the total cost after an 6% of GST. Your program must use the following functions, given...

  • PHP Programming Question. Use the techniques you learned so far to create an Address Book application...

    PHP Programming Question. Use the techniques you learned so far to create an Address Book application that stores names, e-mail addresses, and phone numbers in a text file. Validate all input fields and include functionality that allows the user to view the address book. Also, include code that sorts the address book by name and deletes duplicate entries. Each page in the application should have a link back to the main page. Be creative and add extra features if you...

  • PHP Program Complete PHP code (and HTML Code) Using functions to abstract the logic away from...

    PHP Program Complete PHP code (and HTML Code) Using functions to abstract the logic away from the rest of your code makes it easier to read and maintain. PHP provides a number of useful functions as standard, and this week you will use some of these functions to obtain information. Create a program that compares two strings provided on an HTML form, and determine if the two strings are anagrams. The HTML page asks the user for the input strings,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT