CalcBuilder Forum

Email - random errors

User moon_474 2012-05-15 05:09:26

Hello,

I am having a strange issue with the "send an email" feature and I am uncertain what is causing it. After the formula is calculated the send an email box pops up and when i enter an email address and click send a random error appears.

Sometimes the error is just three numbers like; 901, 121, etc and sometimes its the sum of the form. I does not say email sent or anything like that - but heres the storage in it all, the email does get sent.

Here is the code that I am using for cubic weight calculator, figured I add this just in case something was wrong here:

$cubic=$len1*$wit1*$hei1/166;
$actual=$act1;
$sum=$cubic;
if ($actual > $cubic)
echo ($sum=$actual);
else
echo ($sum);
$sum=number_format($sum,2);
$cubic=number_format($cubic,2);
$total=$rates1*$sum;
$total=number_format($total,2);

Thanks

Moonsoft support 2012-05-15 10:02:57

Hello,
checking your code, maybe you're getting that strange output due to the 'echo' instruction you're using. In fact, you don't need to use it at code section to have the values assigned properly. So,

if ($actual > $cubic)
echo ($sum=$actual);
else
echo ($sum);

is the same as

if ($actual > $cubic)
$sum=$actual;


and maybe you will get rid of that output containing values.

Hope this helps, best regards

User moon_474 2012-05-16 18:51:03

That worked perfectly! Thank you very much :)

I'm not a PHP coder by any means, I knew it had to her something simple (for a coder anyway)!

Thanks again!!

...
CalcBuilder

Create dynamic calculators

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!