Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7591967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:47:11+00:00 2026-05-30T20:47:11+00:00

I am creating an online order form for multiple products. I need to calculate

  • 0

I am creating an online order form for multiple products. I need to calculate the total cost for the products selected via checkbox and send it as a confirmation e-mail. The value of the checkbox is the price in dollars.

<input type="checkbox" id="product1" name="product1" value="100" />
<input type="checkbox" id="product2" name="product2" value="250" />

In my ‘process.php’ file, I need to total the cost for all items if they are checked.

if(isset($_POST['product1']) && $_POST['product1'] == '100') {
    $product1 = 100;
}

if(isset($_POST['product2']) && $_POST['product2'] == '250') {
    $product2 = 250;
}

$dollars = $product1 + $product2;

When I try to do it this way, $dollars is an empty variable “”. Can someone tell me how to fix this?

Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T20:47:12+00:00Added an answer on May 30, 2026 at 8:47 pm

    There is no syntactical error in your code. So the only explanation is that,

    1. $_POST[‘product1’] does not have value 100 or they are not sent through post at all
    2. $_POST[‘product2’] also does not have value 250 or they are not sent through post as well

    In order to verify this, do a quick var_dump($_POST) at the top of your .php file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an online order entry system in silverlight. I need to send an
I am creating an online enrollment form. When a user advances to page 2,
I am creating a website in which people order takeaways online. How can I
I am creating an online booking system & need to exclude closed days from
I am creating an online booking system & need to exclude closed days from
Hi I'm creating online shop. In this shope people online must be buy files
While creating an online shop application using play-1.2.4 ,I ran into some problems with
I am creating an online exam page for my project. I have a countdown
I'm creating an online game in PHP where users can create playable characters. Each
I am creating an online blog website and for each blog post, I'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.