Answer the question
In order to leave comments, you need to log in
How to correctly pass a variable through the session in php?
There is CMS Opencart. I drive in this value on a specific page (it will be displayed only on a specific page):
<?php
$my_var = "Тут какой-то текст";
$_SESSION['my_var'] = $my_var;
?>
<?php
$my_var = ''; if ( isset($_SESSION['my_var']) ) { $my_var = $_SESSION['my_var']; unset( $_SESSION['my_var'] ); } echo $my_var; ?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question