Hi Guys i have a simple form that selects items with a fixed price.
when i select submit the unit price will shoe a double figure for example 3.50 but the price and total amounts only show a single figure for example 3.5
how do i get these to change to double figures.
Full working example https://www.mywebchambers.co.uk/sample
the form action is code.php and this is it
<?php
$totalprice = 0;
// checkbox values
if(isset($_POST['name'])){
echo "Name: ".$_POST['name'];
echo"<br/><br/>";
}
echo "<table cellpadding=3 border=0 style='float:left'>";
echo "<tr style=\"background-color:#333333; color:white;\"><th>Item</th><th>Unit Price</th><th>Qnty</th><th>Price</th></tr>";
if(isset($_POST['submit'])){
$qnty = $_POST['qnty'];
if(!empty($_POST['lang'])) {
$l = $_POST['lang'];
$i=0;
foreach($l as $value){
$v = explode("::",$value);
$q = $qnty[$v[0]-1];
$p = $v[2]*$qnty[$v[0]-1];
echo "<tr style=\"background-color:#dddddd; color:black;\"><td>".$v[3]."</td><td>".$v[2]."</td><td>".$q."</td><td>".$p."</td></tr>";
$totalprice += $p;
$i++;
}
}
}
echo "<tr style=\"background-color:#003366; color:white;\"><td colspan=\"3\"><b>Total Amount</b></td><td><b>$totalprice</b></td></tr>";
echo "</table>";
?>
any advice thanks