<?php //Checks if the user_type in the session is the same as the parameter. function checkPrivilege($required){ if(session_id() == '') { session_start(); } if($_SESSION['user_type'] != $required){ header("location: ../login.php"); die(); } } ?>