In html, think. session. shows how to set variables in the controller? TP framework I am a beginner
Display ('index/login');} public function logincl () {if (IS_POST) {$ user = M ('member ') -> where (array ('MB _ username' => admin)-> find (); // in HTML, I use {$ Think. session. adminuser}, the code shows the account I am currently logged on to, but I use the following {$ Think. session. test}, it cannot be displayed, blank, $ test = M ('aconfig')-> where (array ('zcinfo')-> find (); // Use {$ Think for my HTML. session. test} the code cannot be displayed. Is there an error in the value of the test variable? (aconfig is the database table name) session ('test', $ test ['zcinfo']); // Use {$ Think for my HTML. session. test} the code cannot be displayed. Is there an error in the value of the test variable? (aconfig is the field name of the database table. I just want to display the face value in the field in html ), distress session ('adminuser', $ user ['MB _ username']); $ _ SESSION ['logintime'] = time (); die ("script document. location. href = '/admin. php/Home/Index/main'; script ") ;}}
Reply to discussion (solution)
In html, the code {$ Think. session. test} is used for display.
In addition, I use htmlEnable registration systemWhy not?
Enable registration system Disable registration system
What is this? You dump ($ test) to see if there is any value?