Hello,
I am trying to pass multiple values, via an implode function. However, it isnt working. Here is the code from the first page, then the second page.
<?php
if(isset($_POST['numItems'])) {
$checkboxes = $_POST['numItems'];
$string = implode($value,"^");
echo $string;
}
?>
<form name='CartItem' action='https://www.ram-mount.com/RamCart/CartPutItem.php' method='POST'>
<input type='checkbox' name='numItems[]' value='RAM-VB-162'>
<input type='checkbox' name='numItems[]' value='RAM-VB-154'>
<input type='submit' value='Add To Cart'>
</form>
Second Page:
<?php
include_once('./CartDBCxn.php');
if (!isset($_COOKIE['sess'])) {
session_start();
$usrSession = session_id();
setcookie('sess',$usrSession,0,'/','ram-mount.com');
} else {
$usrSession = $_COOKIE['sess'];
}
if (isset($_GET['act'])) {
if ($_GET['act'] == 'remove') {
removeCartItem($_GET['part'],$usrSession);
}
}
if (isset($_POST['numItems'])) {
// Process the update code
$numItems = $_POST['numItems'];
$items = $_POST;
echo ("\n\n\n <!-- ");
print_r($_POST);
echo (" --> \n\n\n");
for ($x=0;$x < $numItems; $x++) {
$itm = 'item'.($x+1);
$quan = 'Qty'.($x+1);
changeCartItem($items[$itm],$usrSession,$items[$quan]);
}
}
?>