This is an architectural problem. The exit
function is supposed to function like this. A better solution would be to do something like this:
<?php
if($memberinfo3['rank'] < 1) {
require 'guest.php';
} else {
require 'logged-in.php';
}
?>
Try that instead.
Another option is to redirect them somewhere else. That can be a whole lot cleaner than showing an error message to the user as well.
<?php
if($memberinfo3['rank'] < 1) {
header('Location: /homepage_location.php');
}
?>
But remember, if you use the header
function you have to execute the statement prior to the output buffer being flushed (i.e., before echo
, print
, or other output statements).