i have created a $_SESSION variable in a file named (cart.php) then i called this variable in another page (index.php) , it keeps showing this error : UNDEFINED INDEX ON 'NbrCmd' in index.php meanwhile it's working in cart.php this is 'cart.php' variable declaration and 'echo' :
$nbrcmd = 3;
$_SESSION['nbrcmd_online'] = $nbrcmd;
this is index.php where i called this variable :
<p class="text-shopping-cart cart-total-full"> <?php echo $_SESSION['nbrcmd_online'] ; ?> </p>
the session is already started in the two files , and the index is right !
this code : <?php echo $_SESSION['nbrcmd_online'] ; ?>
works in cart.php but in index.php it's an undefined index .
please help and thanks