I've read 4 or 5 different threads about this so far, but after trying the suggestions, I can't figure this out.
I'm just trying to set a cookie, but on 3 of 5 pages the "Cannot modify" error is showing up. My page still loads though.
This code is in an include on all pages, and it loads before the html on all pages. (it's included in my header.php file, which is on all pages.)
<?php
if (!isset($_COOKIE['loggedinGaArms'])){
header("location:index.php");
exit();
}
else{
$seconds = 2628000 + time();
setcookie(loggedinGaArms, date("F js - g:i a"), $seconds);
}
/**
* Check Logged-in Status via Cookie
*/
?>
My Header.php file (just the first few lines)
<?php
include_once "cookieset.php";/******** SET COOKIE INCLUDE ***/
$page = basename($_SERVER['PHP_SELF']);
?>
<!doctype html><!-------------- FIRST LINE OF HTML ----------->
<html>
<head>
<meta name="robots" content="noindex">
<meta charset="UTF-8">
<title>Georgia Arms Inventory</title>
<link rel="stylesheet" type="text/css" href="_/style.css">
<script type="text/javascript" src="_/custom.js"></script>
</head>
<body>
<!-- Start Main Content -->
<div id="content">
Both my database and html are UTF-8.