PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I am trying to do a simple redirect, but am having some serious issues with it all. No matter what I do, everytime I try to use header(), I get this message. (I've changed the file info)
Warning: Cannot modify header information - headers already sent by (output started at drive:/host/folder/filename.php:10) in drive:/host/folder/filename.php on line 14
I've checked this syntax over and over and there doesn't seem to be anything wrong with it. Here's the code.
OK, thanks for the reply, and I understand now that I need to be careful what i can use before I use a header tag.
The problem I have though, is that I tried to do the same thing WITHOUT trying to create the variable, and it still did it. I commented it out, I deleted it, I tried renaming the file, but it still didn't work. Any ideas?
Well, after I sent that last post, about 5 mins after I first deleted everything, it decided it was going to work, and since then I've been testing it with everything I can to make sure it's going to hold up. I'm currently using output buffering to make sure it holds up. And so far it is. Thanks all for you help.
you must use output bufferring in this case since you already sent html tags to the browser (and hence a header..) or you can switch to meta tag refresh
shareaweb wrote:you must use output bufferring in this case since you already sent html tags to the browser (and hence a header..) or you can switch to meta tag refresh
or you can just make sure you don't output anything to the browser before you try and use the header() function, not every circumstance requires output buffering.