<?php session_start(); set_time_limit(0); require 'classes.php'; $pass = new credentials(); if (isset($_POST['password']) && $pass->checkPassword($_POST['password'])) { $_SESSION['loggedin'] = true; } $error = ""; if (isset($_POST['password']) && !$pass->checkPassword($_POST['password'])) { $error = "Incorrect password.<BR>"; } if (!isset($_SESSION['loggedin'])) { echo <<<EOD <!DOCTYPE html> <html> <head> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="main.js"></script> <link href="main.css" rel="stylesheet"> </head> <body> <div id="container"> <form action="" method="POST"> <h1>Please log in</h1> <span style="color:red">{$error}</span> <input type="password" name="password">