Quote:
Originally Posted by Almeria Property Place got it working fine now, only problem is it raises two points, can you delete individual references in the session? and how do you stop them being added twice? |
To delete, its a bit cumbersome but here goes:
/delete.php?reference=123
Code:
$old = explode(',' $_SESSION['portfolio']);
$new = '';
foreach($old as $ref) {
if ($ref != $_GET['reference']) {
$new .= ',' . $ref;
}
}
$_SESSION['portfolio'] = $new;
Header('Location: portfolio.php');
And to make sure duplicates aren't added:
Code:
if (strpos($_SESSION['portfolio'], ',' . $_GET['reference']) !== false) {
// put the code to add to the session here
}