SyntaxFix
Write A Post
Hire A Developer
Questions
I use following code and it works fine for me.
if(!isset($_SESSION['user'])) { ob_start(); header("Location: https://sitename.com/login.php"); exit(); } else { // my further code }