Chapter 23rd of php and MySQLWeb development uses dialog control in php, and encounters difficulties

Source: Internet
Author: User
Chapter 4 of php and MySQLWeb development uses session control in php. Why is it difficult to get stuck ~? Phpsession_start (); $ _ SESSIO [this article is from www.68idc.cn] N _ [sess_var] HelloWorld; echo $ _ SESSION [sess_var]; echoThecontentof $ _ SESSION [sess_var] is. $ _

Chapter 4 of php and MySQL Web development uses session control in php, and gets stuck in a difficult problem ~ ? Php session_start (); $ _ SESSIO [this article comes from the Internet (http://www.68idc.cn)] N _ ['sess _ var'] = "HelloWorld "; echo $ _ SESSION ['sess _ var']; echo 'thecontentof $ _ SESSION [\ 'sess _ var \ '] is '. $ _

Chapter 4 of php and MySQL Web development uses session control in php, and gets stuck in a difficult problem ~
 Session_start ();

$ _ SESSIO [from the Internet (http://www.68idc.cn)] N _ ['sess _ var'] = "Hello World ";
Echo $ _ SESSION ['sess _ var'];

Echo 'the content of $ _ SESSION [\ 'sess _ var \ '] is'. $ _ SESSION ['sess _ var'].'
';

?>

Running result:
The content of $ _ SESSION ['sess _ var'] is
Why is the $ _ SESSION _ ['sess _ var'] Not printed? Is the session expired?
------ Solution ----------------------
You are
Assign $ _ SESSION _ ['sess _ var'] = "Hello World ";
Echo $ _ SESSION ['sess _ var'];
Of

Do you think $ _ SESSION _ and $ _ SESSION are one thing?

Php should check all errors (make error_reporting = E_ALL in php. ini), so that php will tell you where there is a problem.
------ Solution ----------------------
Session_start ();
$ _ SESSION _ ['sess _ var'] = "Hello World ";
Var_dump ($ _ SESSION );
Related Article

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.