I have this snippet of code that needs to create an amount of money but it appears to be outputting the wrong calculation. Can anyone see where I am going wrong? I'm sure I'm missing character(s) of some sort... :surrender:
You could try helping php out by defining the sessions as variables, and working out the $guardsman_total before adding it to the rest of the script.
I tried the code below, and all variables values such as 100, 50 ect and it worked fine.
PHP Code:
<? $order_total = $_SESSION['order_total']; $guardsman_units = $_SESSION['guardsman_units']; $delivery_charge = $delivery_charge; // just an example, not needed if already defined $guardsman_unit_cost = $guardsman_unit_cost; // just an example, not needed if already defined