PHP and multiple header locations

Posted on Posted in PHP, PHP

Ok, this is going to be a short post since I am in the middle of a rollout. But I am transferring some pages over and I want to make sure customers don’t lose bookmarks that they have, so I redirect with PHP header tags.

Well, you ever thought what would happen if you have multiple header("Location") sprinkled throughout the file, well I’ll tell you.

The last header is the one that gets written and used. Also, my stupid self was thinking a PDF file or something was being generated and in a rush to debug I was echoing out all kinds of DEBUG messages that weren’t working thinking it would stop the header("Location") from working, nope!

My advice to you if you run into the same problem as me, comment out all the header files and then work through them one by one. Could save you some time!