nathgregory Posted September 11, 2011 Share Posted September 11, 2011 Hi, I have an itinerary form at http://www.happydaysremovals.com/estimate.html Customers fill this in, and it uses phpmailer-fe to email the results to myself. I use a HTML .tpl file so I can make the output email look as I want. All that is fine, but I would like a volume calculator. Next to each item on the form, the customer enters the amount of that item, usually 1 or 2. If it was say a setee, I want to define that a setee = 30 cubic feet, for example. Then I want the calculator to calculate the total cubic footage for all the variables, and include it in the html email. I know with javascript this can be done, but I was hoping for a PHP result and for it to somehow work in with phpmailer-fe, for example: </style> <script language="JavaScript"> function write_this() { var setteelarge; var setteemedium; var setteesmall; var setteelarge2; var setteemedium2; var setteesmall2; var setteelargeresult; var setteemediumresult; var setteesmallresult; var total; setteelarge = document.form1.LargeSettee.value; setteemedium = document.form1.MediumSettee.value; setteesmall = document.form1.SmallSettee.value; setteelarge2 = 45 setteemedium2 = 31 setteesmall2 = 22 setteelargeresult = (setteelarge * setteelarge2); setteemediumresult = (setteemedium * setteemedium2); setteesmallresult = (setteesmall * setteesmall2); total = (setteelargeresult+setteemediumresult+setteesmallresult) document.form1.Total_Cubic_Feet.value = total } </script> Basically, I want to be able to include the cubic feet total value to also be emailed to me in the HTML email, but preferably all in PHP. At the moment, I get everyones itinerary, but want to be automatically be able to work out the cubic footage. Thanks Quote Link to comment https://forums.phpfreaks.com/topic/246909-php-calculation-help/ Share on other sites More sharing options...
cssfreakie Posted September 13, 2011 Share Posted September 13, 2011 Have you tried to write any php code? Or do you want people to write that for you? Keep in mind though php is a server side language. So any calculation you php do happens on the server and after that it outputs it to the browser. If you want stuff to be calculated client side, you require either something like javascript or flash or other fancy clientside stuff. btw I Moved this forum to the php coding forum, instead of the html one Quote Link to comment https://forums.phpfreaks.com/topic/246909-php-calculation-help/#findComment-1268607 Share on other sites More sharing options...
nathgregory Posted September 13, 2011 Author Share Posted September 13, 2011 Hi. I've solved it now, butthanks anyway! Quote Link to comment https://forums.phpfreaks.com/topic/246909-php-calculation-help/#findComment-1268655 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.