1 Attachment(s)
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!
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 :)
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. :)
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.
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.
1 Attachment(s)
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)
Re: PHP Problem "Warning Headers..."
by putting headers at the top of the page where they are supposed to be
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.
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
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.
Re: PHP Problem "Warning Headers..."
oh. it seems like it would still work. Thanks for the info :)
Re: PHP Problem "Warning Headers..."
I've posted a FAQ item on this subject.