PDA

View Full Version : PHP form calculator scripts - help


redspiral
January 26th, 2007, 02:55 PM
I would really like to develop the skills to be able to do bespoke PHP formulas and calculations within the page - similar to some of the savings calculators examples below:
http://www.reecl.org/calc_sav.php
http://www.esc.net.au/calculator.php
http://www.minorplanet.com/cars_calculator.php
http://www.netistix.com/calculator/index.php
etc
I am proficient at HTML and CSS and have set up PHP applications (though never really got involved with the code), but would really learn more PHP skills and I have usually found that the best way to learn things is to set a challenge - and PHP in page form calcuations would be really useful.
I have found a couple of tutorials about developing actual PHP calculators (i.e. not what i want) but am not sure I am any closer to figuring this out. Would really appreciate it if somebody could point me in the right direction to get started ...

Buzz
January 26th, 2007, 07:45 PM
It's really just a matter of pulling the form data then running the math required. There's no special hidden secret.

$savings= (((field a * field b) / field c) + field d);

or something similar.

degsy
January 27th, 2007, 03:19 PM
Also see http://uk.php.net/manual/en/language.operators.arithmetic.php

redspiral
January 29th, 2007, 12:11 AM
thanks for the advice.
redspiral