Add items to a list

cart.php

https://pastebin.com/YSsW2Vyc

search.php

https://pastebin.com/7WgsAk6N

I am getting an error on the cart.php page:
Notice: Undefined variable: items

Just so I understand, _SESSION is a global variable that the cart data gets stored on??

$_SESSION is a global array. If using OOP, you would pass objects where they are needed, but I don’t think that is where you are at currently.

I will check the code later, I don’t have access to that site from the office.

Ok thank you so much.

For your cart, you are trying to echo $items outside of the if statement, so the variable doesn’t exist. You want to print it within that statement.

Sponsor our Newsletter | Privacy Policy | Terms of Service