Page 1 of 1

Posted: Mon May 19, 2003 6:49 am
by mikusan
This is driving me nuts... when I try to require_once somefile that has my configuration settings then my header redirect will not work, i don't think there is anything being output when i require somehting but it just won't go.

I have checked my file and there is nothing being printed or echoed... but fact is when i rewuire that file... no work when i copy and paste all contents into where my headers are then it will work... it defeats the whole point of me having a configuration file so please help...

Posted: Mon May 19, 2003 6:57 am
by twigletmac
Are you sure there's absolutely no output in the required file - even a space before <?php will cause problems.

Mac

Posted: Mon May 19, 2003 7:11 am
by mikusan
positive... what is the treshold for that though... i mean what else other than echo or print (only ones i use) that would cause this problem...

Posted: Mon May 19, 2003 7:59 am
by twigletmac
You can have output even if you don't have echo or print statements - any whitespace in the file, like before the opening PHP tag (or after it) will cause problems.

Mac

Posted: Mon May 19, 2003 8:01 am
by twigletmac
PS. I moved this out of the sticky as it doesn't relate directly to it.

Mac

Posted: Mon May 19, 2003 8:57 am
by mikusan
What do you mean by that you mean that i cannot have like
<?php

function something()
{
}
?>

because there is a space after <?php??

Posted: Mon May 19, 2003 9:05 am
by mikusan
AAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHH
*takes breath*
AAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!

OMIGOSH!!!!

k thank you so much d00d...

TO EVERYONE OUT THERE!!!

Darn!! i learned this THE HARD way...spent all day cracking my head at this ... and why? because i had more lines after ?>

IF you want to keep your sanity never leave ANY space before or after the php tags <? ?>

Posted: Mon May 19, 2003 10:16 am
by twigletmac
Sorry, having just reread my post I had meant to say - or after the closing tag... Glad you found the problem though.

Mac