This solution may not be for you but I would use a flash component to do the math and show a response, then push the total sum through to the next php page invisible via flashvars.
Like javascript, flash wont be installed on EVERY users machine but the number left out is so small I deem it as insignificant.
I am a pretty experienced flash developer though so have a natural tendancy to gravitate towards it for calculations and dealing with these kind of scenarios. You could build a pretty polished component to highlight the options the user has and display their benefits etc, and do it pretty quickly.