require('global.php'); if ($bbuserinfo['userid']==0) { header("Location: login.php"); // Or whatever your loginscript url is ;) }