1 if(!session_id()) session_start(); 2 header("Content-type:text/html;charset=utf-8"); 3 if (empty($_SESSION["userId"]) || $_SESSION["type"] == 0) { 4 header("Location:homeLogin.php"); 5 exit(); 6 }