I can't figure out why I receive the error. After pressing the Add button the notice disappears at refresh.
<?php
    session_start();
    //session_destroy();
    $page ='index.php';
    mysql_connect('localhost','root','') or die(mysql_error());
    mysql_select_db('cart') or die(mysql_error());
     if (isset($_GET['add'])) {
        $_SESSION['cart_'.$_GET['add']] +'1';
        }
    function products() {
    $get = mysql_query('Select id, name, description, price from products where quantity > 0 order by id desc');
    if (mysql_num_rows($get) == 0 ) 
    {
    echo "There are no products to display";
    }
        while ($get_row = mysql_fetch_assoc($get)) {
            echo '<p>'.$get_row['name'].'<br/>'
                      .$get_row['description'].'<br/>'
                      .number_format($get_row['price'],2)
                      .' <a href="cart.php?add='.$get_row['id'].'">
                         Add
                         </a>
                 </p>';
            }
    }
    echo $_SESSION['cart_1']
?>
--------and index.php
<?php require 'cart.php' ?>
<html>
<head>
</head>
<body>
<?php products(); ?>
</body>
</html>
After executing index.php for the first time, I receive the error: Notice: Undefined index: cart_1 in E:\xamp\htdocs\ShopCart\cart.php on line 35
 
     
    