Hi,
I'm trying to get my head around using classes. I'm playing around with the example on
viewtopic.php?t=8873.
Everything works fine except when I try and use a header() redirect - I get the error message saying that output has already started (as happens if something is echoed before the header()). It says that the output started in the class file - even if I comment every in the class out, it still does it.
Can anyone tell me why this is happening?
Does it have anything to do with instantiating the class, does that start an output?
thanks
rj
[SOLVED]Class / headers problem
Moderator: General Moderators
-
rubberjohn
- Forum Contributor
- Posts: 193
- Joined: Fri Feb 25, 2005 4:03 am
[SOLVED]Class / headers problem
Last edited by rubberjohn on Thu Mar 23, 2006 3:40 pm, edited 1 time in total.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Class / headers problem
Have you got a space or a blank line before your opening PHP tag perhaps? Error messages sometimes cause output too.rubberjohn wrote:Hi,
I'm trying to get my head around using classes. I'm playing around with the example on
viewtopic.php?t=8873.
Everything works fine except when I try and use a header() redirect - I get the error message saying that output has already started (as happens if something is echoed before the header()). It says that the output started in the class file - even if I comment every in the class out, it still does it.
Can anyone tell me why this is happening?
Does it have anything to do with instantiating the class, does that start an output?
thanks
rj
-
rubberjohn
- Forum Contributor
- Posts: 193
- Joined: Fri Feb 25, 2005 4:03 am