Hi,
I'm building a shopping cart program for a friend's small business. The cart works flawlessly, but there is a small part I am currently working on, where the user puts in their zip code, and a script (one I got off PHP Builder) looks up the postal zone, then the weight, and returns the shipping price.
Getting the zone works fine:
$tzip = $HTTP_POST_VARS['tzip'];
$zip = $tzip;
$var = GetZoneFromZip($zip);
echoing out $var brings up the appropriate postal zone.
The problem I'm having is the part where it looks up the zone and returns a price. Here's a smippet from that script:
function CalcPriMail($lb,$zone) {
$lb = ceil($lb,0);
if ($lb == "1" && $zone == "1") { return "3.85"; }
The code I am using to get the return value from that script is below:
$lb = "$qttl";
$zone = "$var";
$shipping = CalcPriMail($lb,$zone);
$qttl is a variable obtained by a mySQL query retrieving the quantity of items in the shopping cart, divided by two. (since all their products weigh 8oz, nothing else is needed to calculate weight).
The error I get is:
Warning: Wrong parameter count for ceil() in /home/...... in line 13
So - anyone have any ideas what I'm doing wrong here? 🙂
-H