Hi Guys,
I run a website for a guy that I know that owns his own bait rolling company. The more bait people order, the less it costs them - to avoid confusion, I've created a little 'calculator'. However, he's now changed his prices, and I can't get it to work.
The code I currently use is:
The prices he now has are:
Up to 50Kg = £5.50 per kilo
50kg - 100Kg = £5.00 per kilo
100Kg plus = £4.50 per kilo
If someone can help me out that be great - my code is probably really poor too, so any advice on that would be great!
Thanks in Advance
I run a website for a guy that I know that owns his own bait rolling company. The more bait people order, the less it costs them - to avoid confusion, I've created a little 'calculator'. However, he's now changed his prices, and I can't get it to work.
The code I currently use is:
Code:
<?
$amount = $_POST['amount'];
$kilob="6";
$kiloa="5";
$ten="10";
$msg="standard message<br />";
if (!$amount || $amount<0) {
echo "Please enter a value that is greater than zero!";
}
else
if ($amount < $ten) {
$sum = $amount * $kilob;
echo "$msg";
echo "<center><b>For $amount Kg your estimated price is: £$sum</b></center>";
}
else
if ($amount >= $ten) {
$sum = $amount * $kiloa;
echo "$msg";
echo "<center><b>For $amount Kg your estimated price is: £$sum</b></center>";
}
else
echo "Error - Please try again";
?>
The prices he now has are:
Up to 50Kg = £5.50 per kilo
50kg - 100Kg = £5.00 per kilo
100Kg plus = £4.50 per kilo
If someone can help me out that be great - my code is probably really poor too, so any advice on that would be great!
Thanks in Advance