[thelist] PHP Doubling up

Jay Blanchard jay.blanchard at niicommunications.com
Wed Aug 14 09:25:02 CDT 2002


[snip]
ok removed it to leave this and no joy, going to sound thick now but how do
I
php Insert a print statement to print out your key/value pairs?
[/snippish]


/* Lets get the total of products and the total cost */

function status($cart) {
	if($cart) {
		foreach ($cart as $item => $value) {

		$number += $cart[$item][qty];

		$total += ($cart[$item][qty] * $cart[$item][unit_price]);
print($number . ", " . $total . "<br>\n"); // <----- HERE!
		}

		$total = correct($total);

		$return = "Your order contains <strong>".$number." </strong>";

        $return .= "items costing a total of
<strong>&pound;".$total."</strong>";

	}
	return($return);
}


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.381 / Virus Database: 214 - Release Date: 8/2/02

--
For unsubscribe and other options, including
the Tip Harvester and archive of thelist go to:
http://lists.evolt.org Workers of the Web, evolt !






More information about the thelist mailing list