zero-perfoliate
zero-perfoliate

Author Topic: Cannot Modify Header Information ? (Login Problem)  (Read 442 times)

Offline Padini

  • New PHP Members
  • Posts: 2
  • Karma: +0/-0
Cannot Modify Header Information ? (Login Problem)
« on: January 28, 2009, 04:04:30 AM »
I get this error when trying to log in to my page :

Not logged in
Warning: Cannot modify header information - headers already sent by (output started at /home/www/bulletkiss.co.cc/FacebookApp/setup/inc/genfunc.php:68) in /home/www/bulletkiss.co.cc/FacebookApp/setup/inc/login.php on line 6


I have Googled this problem & found out that the cause might be because of the white space problem ,but I don`t see any empty spaces before and after the php tags anywhere in the files stated from the error message ?

This is what line 68 on my genfunc.php says :

   }else{
      print "Not logged in";


and line 6 on login.php says this :

   header("Location:/index.php");

Can someone please point out the cause of the error ?

Please and thank you !

Offline McKaulick

  • PHP Workers
  • **
  • Posts: 7
  • Karma: +0/-0
  • McKaulick - http://twitter.com/mckaulick
Re: Cannot Modify Header Information ? (Login Problem)
« Reply #1 on: January 28, 2009, 08:40:16 AM »
Header line will error out if there are a print/echo before.

http://us.php.net/header

Offline Padini

  • New PHP Members
  • Posts: 2
  • Karma: +0/-0
Re: Cannot Modify Header Information ? (Login Problem)
« Reply #2 on: January 29, 2009, 06:40:35 AM »
Thanks for the link ,I added the ob_start() and ob_end_flush() in my script .It fixed the problem ,however when I click log in ,the page sort of refreshes itself and what I keyed in is gone ?

By the way ,what is echo ?I am so sorry I am still quite new to this ...

Offline PhPHelper

  • http://Digiscapers.com
  • Full Member
  • PHP Problem Solvers
  • ****
  • Posts: 179
  • Karma: +50/-0
    • Bad Apple Mail
Re: Cannot Modify Header Information ? (Login Problem)
« Reply #3 on: February 10, 2009, 05:02:07 PM »
echo is the same as print does the same job.

Sounds like when you log in the page is loading the function and the header is directing you to index.php do you have code to show different content if logged in or is it supposed to redirect you to another page when logged in?