I'm developing an application with ExtJS 4 and PHP. My problem is this: How do I prevent the user from being able to access an application page without being logged in? I've tried everything (that I know), but it's as if HTML ignores the check I make.
IndexPrincipal page:
<!DOCTYPE HTML>
<?php
include('connect.php');
session_start();
if (!$_SESSION['logado']){
header("Location: index.html");
session_destroy();
}
?>
<html>
<head>
<meta charset="UTF-8">
<title>SIG - Sistema Integrado de Gestão - EMCM/RN</title>
<!-- <x-compile> -->
<!-- <x-bootstrap> -->
<link rel="stylesheet" href="bootstrap.css">
<link rel="stylesheet" href="resources/css/app.css">
<script src="ext/ext-dev.js"></script>
<script src="bootstrap.js"></script>
<!-- </x-bootstrap> -->
<script src="app.js"></script>
<!--<script type="text/javascript" src="app/view/Login.js"></script>-->
<!-- </x-compile> -->
</head>
<body></body>
</html>