x0prah_Winfr3yx
01-24-2009, 09:05 PM
hello, this is my first post so thanks for reading up on it.
i'm having issues with my 1st switch statement, can you tell me what looks incorrect in my code?
what i'm trying to accomplish is getting the final total of price plus state tax per state.
<?php
$price == 20.00
$cust_state == "TX";
?>
<?php
switch ( $cust_state )
{
case "OR":
$salestax = 0.5;
break;
case "TX":
$salestax = 0.3;
break;
case "CA":
$salestax = 1;
break;
default:
$salestax = 0.1;
break;
}
$final_price = $price * $salestax;
?>
<?php echo "the final total is $final_price"; ?>
I'm getting back "the final total is 0"
i'm having issues with my 1st switch statement, can you tell me what looks incorrect in my code?
what i'm trying to accomplish is getting the final total of price plus state tax per state.
<?php
$price == 20.00
$cust_state == "TX";
?>
<?php
switch ( $cust_state )
{
case "OR":
$salestax = 0.5;
break;
case "TX":
$salestax = 0.3;
break;
case "CA":
$salestax = 1;
break;
default:
$salestax = 0.1;
break;
}
$final_price = $price * $salestax;
?>
<?php echo "the final total is $final_price"; ?>
I'm getting back "the final total is 0"