Jump to content

Archived

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

Dville

Header error

Recommended Posts

So I have put together a membership area into the current script I am coding.

After some modding I seem to be getting this error.
[code]Warning: Cannot modify header information - headers already sent by. . .[/code]

It shows this error for line 171, 172, and 175.

I don't remember doing anything to the login page, but i believe it has to do with in if/else syntax issue. Thanks in advanced to anyone that can help.

go here to see the page im getting the errors on
http://phpfi.com/127501

Share this post


Link to post
Share on other sites
The reason its doing that is because you are outputted text/html to the browser before you use setcookie and the header function

These functions cannot be used after there has been output. As they need to send header information to the server, but the header information has already been sent by the text/html.

The way to fix this is add ob_start(); after your opening <?php tag and add <?php ob_end_flush(); ?> after your closing html tag, line 213, so your code looks like this:
[code=php:0]  1 <?php
  2 ob_start();

// rest of lines

213 </html>
214 <?php ob_end_flush(); ?>[/code]

Share this post


Link to post
Share on other sites
bad ass, i'd give you a karma point if i knew how, lol

im not sure what this function truely does. but i'll try to make some sense of it @php.net
thanks again wild

Share this post


Link to post
Share on other sites

×

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.