Results 1 to 12 of 12

Thread: PHP Problem "Warning Headers..."

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    95

    Question PHP Problem "Warning Headers..."

    Warning: Cannot modify header information - headers already sent by (output started at /home/luke/public_html/vip/index.php:4) in /home/luke/public_html/vip/members.php on line 144
    Welcome Lukeidiot, Enjoy your stay.

    PHP Script is attached.

    Upload at: http://vip.lukeidiot.com try it out.

    Thanks in advance!
    Attached Files Attached Files

  2. #2
    Hyperactive Member
    Join Date
    Dec 2004
    Posts
    326

    Re: PHP Problem "Warning Headers..."

    Line 4 of index.php is most likely the issue. What is it? I skimmed through your members.php , not to criticize your work, but it is quite confusing and difficult to follow. Just an observation though

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    95

    Re: PHP Problem "Warning Headers..."

    Quote Originally Posted by zalez
    Line 4 of index.php is most likely the issue. What is it? I skimmed through your members.php , not to criticize your work, but it is quite confusing and difficult to follow. Just an observation though
    Thanks for the advice.
    It's actually easier then you think. I basically coded all the "members system"
    scripts into "members.php" login, register, logout and all that good stuff is in
    members.php, i just use gets and includes.

  4. #4
    Hyperactive Member
    Join Date
    Dec 2004
    Posts
    326

    Re: PHP Problem "Warning Headers..."

    That is a good idea, I just think using switches in place of what you probably should be using functions, is a bad idea.

    But I am still curious what line 4 of index.php is.

  5. #5
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: PHP Problem "Warning Headers..."

    Once output has been sent, you can no longer send headers. Without seeing the code i can already tell you that.
    My usual boring signature: Something

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    95

    Re: PHP Problem "Warning Headers..."

    Quote Originally Posted by dclamp
    Once output has been sent, you can no longer send headers. Without seeing the code i can already tell you that.
    Ahh how do i fix that?
    heres the
    index.php page. (attached)
    Attached Files Attached Files

  7. #7
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: PHP Problem "Warning Headers..."

    by putting headers at the top of the page where they are supposed to be
    My usual boring signature: Something

  8. #8

    Thread Starter
    Lively Member
    Join Date
    Aug 2007
    Posts
    95

    Re: PHP Problem "Warning Headers..."

    Quote Originally Posted by dclamp
    by putting headers at the top of the page where they are supposed to be
    What would i have to put.

  9. #9
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: PHP Problem "Warning Headers..."

    well you are trying to set a cookie in members.php and it is not letting you because some where in your script you have included index.php, and index.php has already sent output.

    You may consider using a function that is declared at the top to set the cookie
    My usual boring signature: Something

  10. #10
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: PHP Problem "Warning Headers..."

    Quote Originally Posted by dclamp
    You may consider using a function that is declared at the top to set the cookie
    That's not going to help, because it'd still be called from the same point in the script, i.e. after the headers had been sent.

    The only solution to this problem is to re-organise your code so that all processing is always completed before output begins.

  11. #11
    WiggleWiggle dclamp's Avatar
    Join Date
    Aug 2006
    Posts
    3,527

    Re: PHP Problem "Warning Headers..."

    oh. it seems like it would still work. Thanks for the info
    My usual boring signature: Something

  12. #12
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: PHP Problem "Warning Headers..."

    I've posted a FAQ item on this subject.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width