开发者

_SESSION variable not working

开发者 https://www.devze.com 2023-02-14 19:10 出处:网络
I have a PHP script where I try to get a session variable before the HTML headers start. If I use the 开发者_如何学编程_SESSION variable somewhere in the body of the HTML, for some reason it works.Bu

I have a PHP script where I try to get a session variable before the HTML headers start.

If I use the 开发者_如何学编程_SESSION variable somewhere in the body of the HTML, for some reason it works. But if I use the _SESSION variable before the HTML starts, I can't get the values out of it.

Would anyone know why this is happening and how I can get the values out of the session variable?


Put session_start(); before using $_SESSION variable.

0

精彩评论

暂无评论...
验证码 换一张
取 消