Sorry no you can't have my code.
A few pointers though.....
Options for storing cart contents:
1) have a DB table, have a primary key id that auto increments. when visitor enters site create new entry in table, take last inserted id using mysql_insert_id(your_database_link) and set in a variable that you then pass to every page, store id numbers of "products" as delimited string e.g. 001:003:005:002 in table entry, use string funtions to append and remove items
2) Do the same thing but store it in a PHP session variable (requires user to have enabled cookies) then you don't have to pass anything about just session_start() at the top of each file, you could store the cart contents as either a delimited string or in an array of the form array[item_id]=quantity
thus 2 number of item 003 would be represented as array[003]=2
Hope this helps,
Dave