I have my session working apart from one thing…
The output from the var_dump($_SESSION); at the bottom of the code after adding two items is:
array(1) { [“lightbox”]=> &array(2) { [0]=> string(5) “29576” [1]=> string(5) “29509” } }
How do I remove just one ID number? Is it an array I am trying to delete rather than a session variable?
Any help would be greatly appreciated!!
PAGE 1:
<form action=’lightbox.php’ method=’POST’>
<input type=’hidden’ name=’img’ value=”<?php echo($id)?>”>
<input type=’submit’ value=’Add to Lightbox’>
</form>
PAGE2:
<?php
foreach ($_POST as $field => $id)
$_SESSION[‘lightbox’][] = $id;
foreach($_SESSION[‘lightbox’] as $id)
{
echo “Image ID: $id<br><br>n”;
}
echo “<br><br>”;
var_dump($_SESSION);
echo “<br><br>”;
?>