0

Hello,

I am trying to Build a Form where the use clicks on check boxes and radio buttons. I want each to have a cash value to them and calculate the final price once the User clicks submit. I've read around the web and have tried changing the value in my checkboxes to the price I want, but his does not seem to be working.

HTML FORM

<form method="post" action="pricing.php">
<input type="radio" name="pictures" value="50">
<input type="radio" name="pictures" value="25">
<input type="radio" name="pictures" value="0">

<input type="checkbox" name="literatures" value="50">
<input type="submit" name="go" value="calculate">
</form>

Pricing.php

if($go){
$pictures=$_POST['pictures'];
$literatures=$_POST['literatures'];
$total=$pictures+$literatures;

echo $total;
}

The code seems to process but nothing appears. Any tips?

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by RazorRamon
0

Hello,

I am trying to Build a Form where the use clicks on check boxes and radio buttons. I want each to have a cash value to them and calculate the final price once the User clicks submit. I've read around the web and have tried changing the value in my checkboxes to the price I want, but his does not seem to be working.

HTML FORM

<form method="post" action="pricing.php">
<input type="radio" name="pictures" value="50">
<input type="radio" name="pictures" value="25">
<input type="radio" name="pictures" value="0">

<input type="checkbox" name="literatures" value="50">
<input type="submit" name="go" value="calculate">
</form>

Pricing.php

if($go){
$pictures=$_POST['pictures'];
$literatures=$_POST['literatures'];
$total=$pictures+$literatures;

echo $total;
}

The code seems to process but nothing appears. Any tips?

Could it be that i Need to use WAMP to test the code? I though Wamp was only if you need to test mysql/php script.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.