Ok so, Im building a site using php includes, and I want to log out, but my log out page is a include, and the includes take place halfway down the page, so it throws the error
cannot modify headers, headers already sent by the template page
so I figure the logout script has to be the first thing on the page, right? but since it doesnt need any input anyway, I figured how about setting that link to go to a whole new invisible page called logout.php, instead of another include. Ok so that would work, the question is, how do I get that page to then automatically redirect back to somewhere else I specify, after its executed that code? Also ideally Id like to send some vars back with it- like err.. to say whether logout was sucessful or not. But Im lost.. I cant seem to figure out how to redirect atall, other than by using something that changes the headers (slightly out of my depth, but far as i can tell that doesnt execute the code on the page youre redirecting from, just bounces you off somewhere else straight away)