A: 

If Orange is included when you get Blue, then it probably shouldn't be 2 different yes/no choices.

Instead, it should more likely be one question:


Which plan would you like? Orange (150) Blue (250)

seanmonstar
A: 

Yes, an if/else is the way to go. You can accomplish this in-line with the ternary operator.

Change this:

$total = ($_POST['one'] + $_POST['two'] + $_POST['three'] + $_POST['four'] 
+   $_POST['five'] + $_POST['six'] + $_POST['seven'] + $_POST['eight']+ 
$_POST['nine'] + $_POST['ten']+ $_POST['eleven'] + 
$_POST['twelve']+ $_POST['thirteen']);

To this:

$total = ($_POST['one'] + $_POST['two'] + $_POST['three'] + $_POST['four'] 
+   $_POST['five'] + (($_POST['four'] > 0) ? 0 : $_POST['six']) + $_POST['seven'] + $_POST['eight']+ 
$_POST['nine'] + $_POST['ten']+ $_POST['eleven'] + 
$_POST['twelve']+ $_POST['thirteen']);

This assumes that your $_POST values are integers.

zombat
Thank you so much - That did the trick!
A: 

Yes you need some if/ else logic

if( empty($_POST['blue'] ) && !empty($_POST['orange'] ) )
{
    $_POST['total'] += $_POST['orange'];
}

Orange only gets added if blue if false. (note I use empty() to avoid warnings about undefined variables)

Out of curiosity why are you naming the post variables by number? Naming by name might make it less confusing when you have to modify it in the future.

Cfreak