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.
精彩评论