NickG21 Posted January 25, 2007 Share Posted January 25, 2007 hey everyone i was just wondering if anyone had ever constructed a calculator in php. i looked through multiple examples online and found only very basic calculators.what i am looking to do is make a form with three input boxes.....List SizeMessage SizeMail Sent Per Week.Depending on the values entered i want to do calculations and redisplay the prices in 6 different textboxes. 3 for an enterprise edition and 3 for a professional edition.here is a beginning of the code i am looking at but i already am unsure how to handle the input. maybe a select case??any help is appreciated.thank you[code]if(isset($_POST['submit'])){$ListSize = $_POST['ListSize'];$MessageSize = $_POST['MessageSize'];$MailSent = $_POST['MailSent'];$ProfListOnly = $_POST['ProfListOnly'];$ProfTotal = $_POST['ProfTotal'];$EntListOnly = $_POST['EntListOnly'];$EntTotal = $_POST['EntTotal'];$Bandwidth = $_POST['Bandwidth'];if(intval($ListSize) <= 2000){ $EntTotal = "$45"; $EntListOnly = "$45";else if(intval($ListSize) <= 3000){ $EntTotal = "$60";and so on and so forth......} }?>[/code] Link to comment https://forums.phpfreaks.com/topic/35672-form-calculator-in-php/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.