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 );