Click to See Complete Forum and Search --> : PHP Problem "Warning Headers..."
Lukeidiot
Oct 17th, 2007, 10:16 PM
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!
zalez
Oct 17th, 2007, 10:42 PM
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 :)
Lukeidiot
Oct 17th, 2007, 10:44 PM
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. :)
zalez
Oct 17th, 2007, 10:47 PM
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.
dclamp
Oct 17th, 2007, 11:19 PM
Once output has been sent, you can no longer send headers. Without seeing the code i can already tell you that.
Lukeidiot
Oct 18th, 2007, 02:13 PM
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)
dclamp
Oct 18th, 2007, 04:16 PM
by putting headers at the top of the page where they are supposed to be
Lukeidiot
Oct 18th, 2007, 04:33 PM
by putting headers at the top of the page where they are supposed to be
What would i have to put.
dclamp
Oct 18th, 2007, 06:07 PM
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
penagate
Oct 19th, 2007, 08:36 PM
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.
dclamp
Oct 19th, 2007, 08:45 PM
oh. it seems like it would still work. Thanks for the info :)
penagate
Oct 19th, 2007, 10:15 PM
I've posted a FAQ item on this subject.
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.