How to correct the warning message

joejoe BeginnerLink Clerk
I got 2 warning message during user login:The users is successfully loggin, how can I fix it?

Warning: Cannot add header information - headers already sent by (output started at /home/public_html/connect.php:1) in /home/public_html/setcookies.php on line 9

Warning: Cannot add header information - headers already sent by (output started at /home/public_html/connect.php:1) in /home/public_html/setcookies.php on line 10
Hello User1!

Comments

  • martian2k4martian2k4 Llama Hunter Moderator
    Have you got <head></head> tags on ur page at the top?
    Free MySpace Layouts- Coming soon
    Photoshop Tutorials- Coming soon
    Premium PHP Scripts- Coming soon

    Haha i should really do some work so i can remove all the coming soon's
  • NuvoNuvo Forum Leader VPS - Virtual Prince of the Server
    You can't send headers more than once.
    You can get around this using PHP's output buffering features (it stores all the output till you tell it to send it to the end user or you could try fixing the problem with multiple headers.
    PHP, CSS, XHTML, Delphi, Ruby on Rails & more.
    Current project: CMS Object.
    Most recent change: Theme support is up and running... So long as I use my theme resource loaders instead of that in the Rails plug-in.
    Release date: NEVER!!!
  • PythonPython Forum Leader The Royal RAM
    This usually means that your trying to set a cookie after page output has begun. Try moving the code for setting the cookie above any html code so that it happens before any html is read.

    The Royal Ram

  • Mr.TechMr.Tech Beginner Link Clerk
    At the very top of the page just after the very first <?php tag add:

    ob_start();

    And just before the very last ?> add:

    ob_end_flush();

    That will fix your error.
  • joejoe Beginner Link Clerk
    Thx, Mr Tech, very useful
Sign In or Register to comment.