Answer the question
In order to leave comments, you need to log in
How to get value from session array?
How to get value from session array?
$this->session->data['session_name'] = '123';
print_r($_SESSION)
( [default] => Array ( [language] => ru [currency] => USD [customer_id] => 4 [shipping_address] => [user_id] => 1 [token] => Y8mXfPEvDDHwYCuGgPYllp2Fb1PJ1lVV [name] => fio [session_name] => 123 ) )
при попытке вывода echo $_SESSION['session_name'];
Notice: Undefined index: name in /home/u932152297/public_html/catalog/view/theme/default/template/common/header.tpl on line 106
Answer the question
In order to leave comments, you need to log in
How about a little thought?
Look at the contents of $_SESSION?
Look at the code you are calling?
Read error?
Attention to detail distinguishes a good programmer from a calocoder. This applies to everything, including debugging, system messages, as well as normal variable naming.
once again, carefully and letter by letter, read the debug:
[default] => Array ( [session_name] => 123 )
look at what they first wrote in general $key = $_SESSION['name'] (obviously a fakap by inattention), and then pull $_SESSION ['session_name'], although the debug seems to hint that everything is put into the default $_SESSION['default'] array, not to be confused with manual addition if that happens.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question