Forum Moderators: coopster
<? session_start();?>
<?
if (isset($_POST['add'])) //if an item was added
{
$selected=$_SESSION['selectedcomic']; //the item selected
if (!isset($SESSION['basket'])) //if array dosent exist, create it
{
$_SESSION['basket'] = array();
$_SESSION['basket'][] = $selected; //add item to array
}else{
$_SESSION['basket'][] = $selected;
}
}
foreach ($_SESSION['basket'] as $item) { //display contents of array
echo "$item<br />";
}
?>
Thanks in advance.
Again i do agree with the error reporting, make it as reporty as possible, if its a dev box edit your php.ini like to this and restart your http service:
error_reporting = E_ALL & E_NOTICE & E_STRICT
Dont forget to set display_errors to On
[edited by: PSWorx at 1:02 pm (utc) on Mar. 15, 2007]