Jump to content

Help... "Cannot modify header information - headers already sent by"


sh0wtym3

Recommended Posts

I can't figure out what headers are being sent before line 8 ? There's no whitespace before the <?php tag

 

<?php
session_start();
// Only Administrators have access to view this page
$permissions = $_SESSION['permissions'];

if ($permissions !== "Administrator") {
$_SESSION['page'] = "welcome";
header("Location: /seo/");
die('');
}
?>

 

Thanks in advance

In your error message you should have information 'output started at ... '

See what's in the file/line it indicates.

 

Output started at line 10, here are lines 9-11:

die('');
}
?>

 

Once again the full code so you can put it into context:

<?php
session_start();
// Only Administrators have access to view this page
$permissions = $_SESSION['permissions'];

if ($permissions !== "Administrator") {
$_SESSION['page'] = "welcome";
header("Location: /seo/");
die('');
}
?>

I think I figured out why there would be output, that code is part of 'pageB.php' which is nested inside of 'pageA.php' like so:

 

<?php
// Page A code blah blah blah

require 'pageB.php';

// More page A code blah blah blah
?>

 

The output is coming from page A so I know how to fix the problem, thanks for the assistance

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.