Hey all,
I've just come accross an issue which has only just started happening for no apparent reason! I may have changed something to make it not work, but not to my knowledge as I've only been editing bits which haven't caused it before.
Basically, in my code I have a class with a function, containing the following code:
header("Location: ".$this->page_login."?redirect=".$_SERVER['PHP_SELF']);
//print $this->page_login."?redirect=".$_SERVER['PHP_SELF'];
exit;
This is in an else statement, which I know works - because if I uncomment the print line in the code above, it's printed out.. so the header() function is being passed over, without redirecting..
I know header() doesn't work if something has already been printed to the page, however in this case - nothing is, and I'm sure you receive an error talking about that case if it occurs anyway?
Are there any common reasons to why this would not work?
When placing the below in a file, it works.. so header() work in a usual case..
header("Location: http://www.google.com/");
Any help would be much appreciated 🙂
Thanks~