Here is the code

<?php error_reporting(E_ALL); ini_set('display_errors','On'); ini_set('session.use_cookies', 'On'); ini_set('session.use_trans_sid', 'Off'); session_set_cookie_params(604800000, "/", ".site.ru", false, false); session_start(); define('SID',session_id()); if (!isset($_SESSION["uid"])){ echo "Хакирование запрещено!"; exit; } include('../conf.php'); $uid = intval($_SESSION["uid"]); header ("Location: ../profile.php"); exit; ?> 

But the error

 Cannot modify header information - headers already sent by (output started at ...general.php:16) in ...general.php on line 15 

Resave without BOM, both the file itself and the config, there are no extra spaces or intero

    2 answers 2

    Go to php.ini and set the following value:

     output_buffering = On 

    PS Do not forget to restart the server on which PHP is installed. This is probably an apache.

      At the beginning

       ob_start(); 

      After all the actions at the end of the script

       ob_end_flush() 

      This buffers the output (except headers). Everything should work after that.

      • ob_end_flush () required to write? - Rammsteinik
      • one
        @Rammsteinik, no, you can just ob_flush() - stck