+ 7
Why we always set session_start() at the top of php pages
4 Antworten
+ 21
Some functions like this and setcookie() must come before html in latest versions of php thus it is usually located on top (you can put it after html if you put ob_start() at the begining instead.....)
+ 9
thanks @ValentineHacker but I m just looking for if there is a reason why?
+ 3
You cannot have any type of output to the browser before starting a session.
+ 3
you don't want to load your headers before session start