Code: Select all
if (!isset($_SESSION['checkbox']) || !is_array($_SESSION['checkbox']))
{
$_SESSION['checkbox'] = array();
}
$_SESSION['checkbox'][] = $_POST['checkbox'];
$_SESSION['checkbox'];
print_r($checkbox);Moderator: General Moderators
Code: Select all
if (!isset($_SESSION['checkbox']) || !is_array($_SESSION['checkbox']))
{
$_SESSION['checkbox'] = array();
}
$_SESSION['checkbox'][] = $_POST['checkbox'];
$_SESSION['checkbox'];
print_r($checkbox);Which variable you are talking about? $checkbox or $_POST['checkbox']?kpraman wrote:checkbox contains prodId's
Code: Select all
if (!isset($_SESSION['checkbox']) || !is_array($_SESSION['checkbox']))
{
$_SESSION['checkbox'] = array();
}
$_SESSION['checkbox'][] = $_POST['checkbox'];
$_SESSION['checkbox']; // what is the need for this line?
print_r($checkbox);Code: Select all
print_r($_SESSION['checkbox']);Code: Select all
<?php
if (!empty($_POST['checkbox']))
{
$_SESSION['checkbox'] = $_POST['checkbox'];
}
?>