stuck building a 'cart management' system <p>I'm trying to build a database for video spots. The main page is a list of spots and you can check them and modify them. What i want to do is build a cart system, where the checked spots' id's are automatically added to the cart and stored as a cookie. That way the use can browse multiple pages while still having everything stay checked.</p> <p>So far, I have a checkbox on every spot that when checked calls a function that adds the id of the checkbox to an array and stores it as a cookie. </p> <p>I'm able to retrieve the cookie through jquery. What I need to do is while looping through the spots and printing them, is to check if that spot id is in the cookie, so I can set it as checked or not through php. Is this possible? Is there a better way to accomplish this?</p> <p>Here is what i have so far.</p> <pre><code>$(document).ready(function(){ var checkedItems = []; $('.spotCheck').click(function(){ var currentID = this.id; checkedItems.push(currentID); updateCookie(); }); function updateCookie(){ $.cookie('itemList',checkedItems); } $('#mainContainer').click(function(){ $('#textInCenter').html($.cookie('itemList') ); }); }); </code></pre> <p>Clicking the checkbox adds the ID to the array checkedItems, and click the mainContainer makes it visible so I can see which items are currently in the array. I can browse through pages and the cookies stay in the array (there's no way to remove them now but I'm not worried about that right now).</p> <p>So how can I check the array to see if an id is in there when I print the list of spots?</p>