Calculate total amount from input

From: Date: Wed, 01 Oct 2003 07:28:35 +0000
Subject: Calculate total amount from input
Groups: php.general 
Request: Send a blank email to php-general+get-164491@lists.php.net to get a copy of this message
Hi all, A PHP question to ask: I am using PHP to do a calculation of the total of fields where user actually input the amount into the text field and I will calculate the TOTAL from the fields as well as the GST. Wonder how should I go about doing that? I did something like : $total = $_POST["field 1"] + $_POST["field 2"] + $_POST["field 3"]; $total = number_format($total, 2, ".", " "); echo "$$total<br>"; echo "$".$total."<br>"; but it wasn't successful. Hope to get some help here. All comments/advice/solutions are welcomed=) Regards, Irin.

« previous php.general (#164491) next »