PHP, Cannot modify header information - headers already sent by?

  • Thread starter Thread starter soccer_boy
  • Start date Start date
S

soccer_boy

Guest
I am getting the following error in my PHP code: Cannot modify header Warning: Cannot modify header information - headers already sent by (output started at /var/www/login22.php:9) in /var/www/login22.php on line 170

Warning: Cannot modify header information - headers already sent by (output started at /var/www/login22.php:9) in /var/www/login22.php on line 171

Warning: Cannot modify header information - headers already sent by (output started at /var/www/login22.php:9) in /var/www/login22.php on line 172.

I tried eliminating and white spaces in the code but I am still getting the error.

part of my code where the error is coming from is as follows:

if($DBinfo->password == $_POST['password'])
{
$hour = time() + 3600;
$mosConfig_locale_debug = 0;
$mosConfig_locale_use_gettext = 0;
setcookie(ID_my_site, $_POST['username'], $hour); // line 170
setcookie(Key_my_site, $_POST['password'], $hour); // line 171

header("Location: memberarea2.php"); // line 172
}
 
Back
Top