php - Redirect to homnepage fails: header already sent -


hi whenever user enters details on login screen, end following error:

warning: cannot modify header information - headers sent (output started @ /customers/2/a/e/somedomain.co.uk/httpd.www/francium/logsys/example-two-step-login/login.php:14) in /customers/2/a/e/somedmain.co.uk/httpd.www/francium/logsys/class.logsys.php on line 448 warning:

setcookie(   "logsyslogin",   hash("sha256", self::$config['keys']['cookie'] . $us_id . self::$config['keys']['cookie']),   strtotime(self::$config['cookies']['expire']),   self::$config['cookies']['path'], self::$config['cookies']['domain'] ); 

cannot modify header information - headers sent (output started @ /customers/2/a/e/somedomain.co.uk/httpd.www/francium/logsys/example-two-step-login/login.php:14) in /customers/2/a/e/somedomain.co.uk/httpd.www/francium/logsys/class.logsys.php on line 1060

public static function redirect($url, $status = 302){   header("location: $url", true, $status);   exit(0); } 

this caused output @ line 14 if login.php. if echo something, php have send headers in order browser able display it. once sent, can't modify them


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -