0

Hi whenever a user enters their details on my login screen, I end up with the following error:

Warning: Cannot modify header information - headers already sent by (output started at /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 already sent by (output started at /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);
}
maxhb
  • 8,554
  • 9
  • 29
  • 53
Rust
  • 11
  • 4
  • 1
    Possible duplicate of [How to fix "Headers already sent" error in PHP](http://stackoverflow.com/questions/8028957/how-to-fix-headers-already-sent-error-in-php) – Qirel Feb 08 '16 at 13:01
  • Made the question at least readable, added propper tagging. – maxhb Feb 08 '16 at 13:40

1 Answers1

0

This is caused by an output at line 14 if your login.php. If you echo something, php have to send headers in order for your browser to be able to display it. Once they are sent, you can't modify them

Gwendal
  • 1,273
  • 7
  • 17