I am setting a session variable inside a function studNameDetails1()
while I am trying to retrieve it in a function ViewMark(). These are my two functions but there is no result:
function studNameDetails1()
{
$_SESSION['ATTsub']=$sub_id = $ID[5];
}
function ViewMark()
{
echo $_SESSION['ATTsub'];
}
When I echo the value in viewMark(), there is no value.
This is the way to handle sessions.
All of the values are stored in the $_SESSION array, which we access here. Another way to show this is to simply run this code: