The code works on localserver. Items get added correctly without any errors. I do have all the error reports turned on too on my localserver. Now the other server is on a certain hosting company so I can't make changes to their php.ini file =/. Sorry about the little info I gave. The file that adds items to the cart and uses the function above is manage.php. So the url looks like this... manage.php?act=add&pid=X. Manage.php looks like this... [code] <?php if (isset($_GET["act"])) { if ($_GET["act"] == "add") // add item { //unserialize($_SESSION["cart"]); if (!isset($_SESSION["cart"])) { // add first item $cart->add_item_to_cart($_GET["pid"],1); } else if (array_key_exists($_GET["pid"], $_SESSION["cart"])) { // add 1 to quantity if item in cart already $cart->add_item_to_cart($_GET["pid"],++$_SESSION["cart"][$_GET["pid"]][1]); } else { // add any other items after first item $cart->add_item_to_cart($_GET["pid"],1); } } elseif ($_GET["act"] == "del") // delete item { $cart->del_item($_GET["pid"]); } } ?> [/code] Here is the full function for adding an item to the cart... [code] <?php function add_item_to_cart($id, $quantity) { // set cookie and store value in session $this->setstp(); db_connect(); $sel_products = mysql_query("SELECT special_pick, special, price, artist, album FROM products WHERE id=".$id.""); $item = mysql_fetch_array($sel_products); // returns the number of rows in a result, if 1 item exists if 0 item doesn't exists. $num_rows = mysql_num_rows($sel_products); // if item exists then add item to cart if ($num_rows >= 1) { session_regenerate_id(TRUE); $_SESSION["cart"][$id][0] = $id; $_SESSION["cart"][$id][1] = $quantity; $_SESSION["cart"][$id][2] = $item['$special_pick] != 0 ? 'y' : 'n'; $_SESSION["cart"][$id][3] = $item['special_pick']; $_SESSION["cart"][$id][4] = $item['special'] == '0.00' ? '0.00' : $item['special']; $_SESSION["cart"][$id][5] = $item['price']; $_SESSION["cart"][$id][6] = $item['artist']; $_SESSION["cart"][$id][7] = $item['album']; header ("location:".$_SERVER['HTTP_REFERER']); } } ?> [/code] Thanks for helping me :).