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?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.