In this problem you have to make a form in html with the following fields:
- Product (use select tag to make a drop down)
- Quantity of product
Invoice should contain following:
- Serial number
- Product name
- Product Picture
- Product Rate
- Product Quantity
- Discount
- Amount
- Net Amount (Amount - Discount)
Let’s start to solve this problem:
To make your form make a file named "product.php" and write below code:
HTML code
Now run your php file by using url → 'localhost/foldername/product.php'
You would see your result like this:
It’s time to make the invoice. Make a file named "bill.php" and add following code in it:
PHP code with HTML
This code fetches the value of quantity and product (chosen by user), sets a rate and discount according to the product choose by user and calculates the total amount and net amount. You can replace the product 1, product 2 ... product 4 values in html form select tag.
As the user hits the submit button after choosing the product and entering the quantity. It will land on Invoice page and you would see like this:
need an explanation for this answer? contact us directly to get an explanation for this answer