I have a header.php file, which is included on every page of a site and it contains things like the information and the opening tag.
Now whenever I try to send header information from another page on the site I know I can't do that because I have already sent HTML to the client computer. So I created a function after much googling and stuck it at the top of the Header.php file:
ob_start();
function redirect($url){
flush();
ob_flush();
header("Location: $url");
die;
}
And I can call that from anywhere else in the site but I still get an error. I'm probably doing this function all wrong, but that's what google will do sometimes. Any help to fix this would be great, thanks.
EDIT: The error I get is "Cannot Modify Header Information - Header already sent by ...". I already have this problem fixed.