January 18th, 2013, 09:05 AM
Headers already sent errro
Ok I know what the problem is. My question is
does doing something like
$variable = "test";
cause problems with this:
January 18th, 2013, 09:13 AM
Only if your code produces errors or warnings, which are then spit to the screen with plaintext headers.
If you do:
You will get a warning about the undefined index 'foo'. If your server is set up to broadcast errors to the screen, that error will show up and the headers will be printed for a plaintext/HTML document.
$a = array();
$b = $a['foo'];
HEY! YOU! Read the New User Guide and Forum Rules
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002
Think we're being rude? Maybe you asked a bad question
or you're a Help Vampire.
Trying to argue intelligently? Please read this.
January 18th, 2013, 10:17 AM
thanks. that wasnt the problem i.e. coding error. I did $foo="bar" instead of $foo = "bar" (spaces removed) and it seemed to work :s.
January 19th, 2013, 09:52 PM
Spaces within your PHP code are not sent as output and won't affect headers.