In html, think. session. shows how to set variables in the controller? TP framework I am a beginner

Source: Internet
Author: User
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?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.