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 9152113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T11:57:51+00:00 2026-06-17T11:57:51+00:00

i was trying to get my check box to output Korting is … %

  • 0

i was trying to get my check box to output “Korting is … %” at the bottom of the page depending on which check box is checked e.g. 2th and 3th boxes are checked it would output “Korting is 15%” but i cant seem to get it to work. can someone please help me
thank you in advance

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="nl">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>XXL Computer winkel</title>
</head>
<body>
<h3>php lab 04</h3>

<table border=0 cellpadding=0 cellspacing=0 width=100%>
<form name="orderform" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<tr> 
<td> 
Korting:<br />
<input type="checkbox" name="korting" value="15" /> Student 15% <br/>
<input type="checkbox" name="korting" value= "10"  /> Senior 10% <br/>
<input type="checkbox" name="korting" value= "5" /> klant 5% <br/> 
<hr/>
<img src="images/Lab4/1.jpg" width="200px" height="200px" alt=" "/>
<td/>
</tr>     
<tr> 
<td>
Toshiba Satellite A100-510 basisprijs 999.99
</td>
</tr>

<tr>     
<td><!-- Shopping cart begin-->
<input type="hidden" name="toshibaproduct" value="001"/>
<input type="hidden" name="toshibamerk" value="Toshiba"/>
<input type="hidden" name="toshibamodel" value="Sattelite A100-510"/>
Aantaal: <input type="text" size=2 maxlenght=3 name="toshibaaantal" value="0"/>
<input type="hidden" name="toshibaprijs" value="999.99"/>

<input type="image" src="images/Lab4/2.jpg" border=0 value="bestellen"/>
<hr/>
</td><!--Shopping Cart END -->
</tr>
</form>
</table> 
</body>
</html>
  • 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-06-17T11:57:52+00:00Added an answer on June 17, 2026 at 11:57 am
    • Use radio instead of checkbox if you want one option to be selected
    • Do not use PHP_SELF, it is a security hole. Instead: <form action="">
    • Access the value with $_POST['korting']

    To sum up all values, make your form like this:

    <input type="checkbox" name="korting[]" value="15" /> Student 15% <br/>
    <input type="checkbox" name="korting[]" value= "10"  /> Senior 10% <br/>
    <input type="checkbox" name="korting[]" value= "5" /> klant 5% <br/> 
    

    and the processing like that:

    <?php
    $korting = 0;
    if (isset($_POST['korting']) && is_array($_POST['korting'])) {
      $korting = array_sum($_POST['korting']);
    }
    echo 'Korting is ' . $korting . '%';
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am having some issues trying to get check box values. For a
i am trying to get a button on my page which will eventually be
I'm trying to get a DialogBox with a check box to appear. I added
I'm trying to get gedit to auto-indent my code. The auto-indent check-box in preferences
i'm trying to get date from UIDatePicker (MM-dd format) and to check if its
So i am trying get 2 div-containers which both should contain centered text (Both
Am trying to pass the selected check box value to the control function. Please
im trying change the background color and tick color of a check box once
I am trying to use FormPanel. oN FormPanel formPanel.setWidget(flexTable); A check box , a
I'm trying to make a check box to show/hide a HTML element, but I

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.