How can I redirect to PHP with this installation below without receiving header output errors, I understand that nothing can be printed in the browser before the header is set, I am looking for a solution, not an explanation of why this is happening.
<?PHP
include ('header.inc.php');
include ('SOME-FILE-HERE.php');
include ('footer.inc.php');
function validlogin($url) {
if ($_SESSION['auto_id'] == '') {
$msg = 'Please login';
$_SESSION['sess_login_msg'] = $msg;
$_SESSION['backurl'] = $url;
$temp = '';
header("Location: /");
exit();
}
}
?>
I would like to use the php header function of the user rather than meta or javascript redirection
Also supported is a list of pages requiring a login or not, if possible, this is not an option
source
share