Re: Form Process Question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 16, 2009 at 11:03, Gary<gwpaul@xxxxxxx> 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:

<?php
$amount = 195;

setlocale(LC_MONETARY,'en_US');
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.brown@xxxxxxxxxxxx || danbrown@xxxxxxx
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



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux