Hey everyone, again, new to php/html,etc. I was just wondering if I have this set up correctly? Im making a products page for paintball supplies and when the customer fills the form out, the submit button is to send them to their receipt that tells them what they bought, how much, total cost, etc.
Can you guys check this over and see if what I have so far makes sense? I dont want to get too into this and find out I messed something up. Thanks! (Ill be posting updates to this post frequently)
[php]<?php
extract($_POST);
if($gun1=="")$gun1=0;
if($gun2=="")$gun2=0
// If any of the quantities are blank, set them to zero
if ($gun1 == “”) $gun1 = 0;
if ($gun2 == “”) $gun2 = 0;
if ($gun3 == “”) $gun3 = 0;
if ($gun4 == “”) $gun4 = 0;
// Compute the item costs and total cost
$gun1_cost = 1669.95 * $gun1;
$gun2_cost = 1650.00 * $gun2;
$gun3_cost = 1650.00 * $gun3;
$tank1_cost = 184.95 * $tank1;
$tank2_cost = 184.95. * $tank2;
$tank3_cost = 184.95 * $tank3;
$mask1_cost = 119.95 * $mask1;
$mask2_cost = 109.95 * $mask2;
$mask3_cost = 135.0 * $mask3;
$hopper1_cost = 189.95 * $hopper1;
$hopper2_cost = 169.95 * $hopper2;
$hopper3_cost = 199.95 * $hopper3;
$total_price = $gun1_cost + $gun2_cost + $gun3_cost +
$tank1_cost + $tank2_cost + $tank3_cost +
$mask1_cost + $mask2_cost + $mask3_cost +
$hopper1_cost + $hopper2_cost + $hopper3_cost;
$total_items = $gun1 + $gun2 + $gun3 +
$tank1 + $tank2 + $tank3 +
$mask1 + $mask2 + $mask3 +
$hopper1 + $hopper2 + $hopper3;
// Return the results to the browser in a table
?>[/php]
ANY AND ALL FEEDBACK IS APPRECIATED!
Thank you again in advance!