On Page 1, I have a list of states and here is a sample of about 5:
PHP Code:
<label for="1"><input id="1" name="area[]" value="1" type="checkbox">Auburn</label><br>
<label for="2"><input id="2" name="area[]" value="2" type="checkbox">Birmingham</label><br>
<label for="3"><input id="3" name="area[]" value="3" type="checkbox">Dothan</label><br>
<label for="4"><input id="4" name="area[]" value="4" type="checkbox">Florence-Muscle Shoals</label><br>
<label for="5"><input id="5" name="area[]" value="5" type="checkbox">Gadsden-Anniston</label><br>
Then on Page 2 I have
PHP Code:
<?
$area = $_REQUEST["area"];
while (list ($key_check,$area_check) = @each ($area))
{
$areas_check .= $area_check.",";
}
$all_areas_check = substr($areas_check, 0, -1);
if(($_SESSION["area"] =="")) {
$_SESSION["area"] = $all_areas_check;
}
$count = count($_SESSION["area"]);
?>
And then later on in the HTML/PHP I was testing to see if it counted the number of items in the newly created "area" session and of course got a value of 1. The $planamount and $region variables were static to begin with so no need to focus on that.
PHP Code:
<?
if(($count > 3)) {
$regions = round($count * 9.95 + $planamount, 2);
$subtotal = ($regions - 29.85);
} elseif (($count < 3)) {
$regions = round($planamount, 2);
$subtotal = ($regions);
}
?>
And when I simply couldn't that to work I just dropped a simple echo command that gave me a value of 1
PHP Code:
<p>Number of items in session: <?=$_SESSION["count"]?></p>
Bookmarks