Hi,
This sounds like an assignment for school, and thus a learning experience,
so I don't particularly feel comfortable just giving you the answers. When
you go about performing tasks like these in a real world environment,
nobody is ever going to just hand you an answer, plus this is extremely
basic PHP knowledge that you'll need to get by. That said, here's the
stuff you'll want to know:
1. How to use arithmetic operators in PHP:
http://us.php.net/manual/en/language.operators.arithmetic.php
2. How to use HTTP variable requests: http://us.php.net/reserved.variables
That will do everything you are supposed to do. Someone may suggest some
AJAX solution, but I'd say that's squarely out of the question since you
*must* use pure PHP.
Cheers!
--
Joe