On Tue, Jun 16, 2009 at 11:03, Gary<gwp...@ptd.net> wrote:
> I have a client that I have made some forms for.  On one of the forms, their
> customers are to registar for a class.  The cost of the class is 195 per
> person.  She would like to have the people be able to have the total cost
> calculated for them before they submit the form. (I already have the cost
> calculated in the email and result page).

    Just to point something out here: based upon the information you
sent to the list, this question sounds ridiculous, because on the
surface, it sounds like, "the class is $195, so how should I calculate
this as a total?"  ;-P

    Sometimes, when doing a project, we forget that *we* know all of
the information, but those with whom we're trying to communicate do
not.  What other figures would be calculated into this?  Is there tax
levied in certain circumstances (like if they live in Pennsylvania)?
Is there an option for registering and paying for multiple
participants on a single order?  Can they pay for more than one class
at once?  Are prices meant to be pulled in real-time from a database
or other remote or dynamic source?

    If all of the above questions are no, then it's even easier:

$amount = 195;

echo money_format('%n',$amount);

    If even one of the questions above is answered with a 'yes,' then
you'll want to consider the alternatives and weigh each option.  Maybe
you'll want to use JavaScript, maybe you'll want to do server-side
processing --- maybe a combination of both (i.e. - AJAX) if you need
to pull from the database and want to present the information without
refreshing/reloading a page.

</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to