Move the session functions above everything else. Also, ob_start
is a function and must be invoked.
error_reporting()
should always be set to -1
while you are working on the code. When it is uploaded to the server it should be set to 0
. It is usually easier to handle it using the php.ini
file.
session_set_cookie_params(3600 * 24 * 7, '/', '.example.com');
session_start();
error_reporting(-1);
ob_start();
// Do something
// Call whateter ob_* function you need
I suggest you always read the documentation. There is a lot of help to be had there. Be sure to read the comments as well.