Jump to content

Recommended Posts

Posted

I keep getting a weird error like this:

Warning: Cannot modify header information - headers already sent by (output started at /home/zyra/public_html/head.php:13) in /home/zyra/public_html/loginact.php on line 20

 

I think it has something to do with some cookies I'm working with. Any insight?

Posted

There are a few things that could cause this, such as misplaced white space somewhere (like at the beginning or end of the file) or any html before any headers are sent.

 

You can enable output buffering to get rid of the error:

Place this at the beginning of your page:
<? ob_start(); ?>

and this at the end of your page:
<? ob_flush(); ?>

  • Like 1
Posted

Header information (cookies, redirect headers, headers) have to be sent before any html output. In other words, your cookies go at the top before any html output.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...