php - COOKIES headers already sent -


this question has answer here:

i have probelm cookie.

error:

cannot modify header information - headers sent (output started @ /data/web/virtuals/9784/virtual/www/subdom/roids/_libs/_lib.php:1) in /data/web/virtuals/9784/virtual/www/subdom/roids/_libs/_lib.php on line 43

index:

<?php session_start(); error_reporting(e_all); require_once('_libs/_console.php'); require_once('_libs/class.phpmailer.php'); require_once('_libs/_lib.php'); //require_once('_libs/passwordlib.phar');  $db = new database(); $func = new functions($db); $cms = new cms_system($func, $db);   $func->setlang(); 

the file _lib.php starts <?php , there no whitespace @ start. file contains classes , functions.

function setlang:

    public function setlang() {      setcookie("lang", "sk", time()+60*60*24*30);     if (isset($_post['lang'])) {         setcookie("lang", $_post['lang'], time()+60*60*24*30);     }  } 

i tried deleting session_start script not work. comments or solutions

remove echo if @ _lib.php file..and try..


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -