If you want it in pure php - that is not so good. To many reloads, but here how it works(it's a bad code, for bad idea):
10000){
echo 'Must be below 10000';
}
elseif($count >= 1 && $count <= 1000){
$price *= 1.2;
}
//Etc...
$total = $price * $count;
}
In my opinion, you should try achieve it with JS(or easier - with jQuery).
First of all, create a form:
Then do something like this:
$(function(){
var price = 10;
var multiplier = 1;
$('#calculate').click(function(){
var count = parseInt($('#count').val());
if(count > 10000){
alert('Must be below 10000');
return;
}
else if(count >= 1 && count <= 1000){
multiplier = 1.2;
}
alert('Current price is ' + price + ' * ' + multiplier + ' = ' + getActualPrice());
});
function getActualPrice(){
return price * multiplier;
}
});
Fiddle