I\'m currently building a control panel based on user_level. If a user has level (0) they can\'t access anything besides the index page, level (1) can access everything.
You are using session like:
session
if($_SESSION["user_level"] == 0) { header('Location: index.php'); }
but session is not started here. Start the session on first line like:
session_start();
only after that you can access the session variable.