Ok I've made up a little mock page here http://www.magicbean.ca/pizza.html
What I want to do is have some one be able to choose what toppings and extras they want then
once it is processed show the confirmation page with all the stuff that they selected complete with the price and total.
What is the way for PHP to find out if a box has been checked or not and then be able to calculate the cost.
Please help.
Thank you.
Dr. Puto
Checkbox form processing.
Moderator: General Moderators
you just need to check if the box is checked with isset, then you could add the value of the box to the total:
ex:
ice += $_POST['pepperoni'];
echo $price;
mp;quote;checkbox" name="pepperoni" value="1.25">
of the box to the total:
ex:
<input type="checkbox" name="pepperoni" value="e;1.25"e;>
e; value="e;1.25"e;>
]
<input type="checkbox" name="pepperoni" value="1.25">
]
ex:
you could add the value of the box to the total:
ex:
eckbox" name="pepperoni" value="1.25">
isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;
then you could add the value of the box to the total:
ex:
ex:
Code: Select all
<input type="checkbox" name="pepperoni" value="1.25">Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;echo $price;
mp;quote;checkbox" name="pepperoni" value="1.25">
Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POSTї'p($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;ex:
Code: Select all
<input type="checkbox"e; name="e;pepperoni"e; value="e;1.25">Code: Select all
$priheck if the box is checked with isset, then you could add the value of the box to the total:
ex:Code: Select all
<input type="checkbox" name="pepperoni" value="1.25">Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;Code: Select all
$price = 10.00;
if(isset($_POSTe9136]
<input type="checkbox"e; name="e;pepperoni"e; value="e;1.25"e;>Code: Select all
$price = 10.00;
if(isset($_POSTї'pepperoni']))
$price += $_POSTї'pepperoni'];
echo $price;<input type="checkbox" name="pepperoni" value="1.25">
Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;ex:
Code: Select all
<input type="checkbox" name="pepperoni" value="1.25">Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;ex:
Code: Select all
<input type="e;checkbox"e; name="pepperoni" value="1.25">Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;Code: Select all
$price = 10.00;
if(isset($_POSTї'pepperoni']))
$pric9136]Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POSTї'pepperoni'];
echo $price;$price += $_POST['pepperoni'];
echo $price;
then you could add the value of the box to the total:
ex:
Code: Select all
<input type="checkbox" name="pepperoni" value="1.25">Code: Select all
$price = 10.00;
if(isset($_POST['pepperoni']))
$price += $_POST['pepperoni'];
echo $price;