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.
I'm getting back "the final total is 0"PHP Code:
<?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"; ?>



Reply With Quote

then click Go Advanced and add the Resolved prefix to the thread title. This will let other users know the problem has been solved.
Bookmarks