forum

Home / DeveloperSection / Forums / Stop items with same id being add in a session

Stop items with same id being add in a session

Pravesh Singh 2246 30-Oct-2014
A quick questions about sessions, I have a session with the following code

<?php
session_start();
$_SESSION['event_orders'][] = $_POST['event_id'];
?>
problem is once I add an item to the session, it can still re-add it again, therefore duplicating it.

How would one preform a check, something like "if ID exists in session, show (remove) instead of (add) button"?

Updated on 30-Oct-2014

Can you answer this question?


Answer

1 Answers

Liked By