<?php /** * Created by PhpStorm. * User: ernestlandrito * Date: 12/7/15 * Time: 10:21 PM */ session_start(); include 'login-session-handler.php'; // Make a new login handler. $login_handler = new LoginSessionHandler(); // Print if logged in. echo $login_handler->IsLoggedIn() ? $login_handler->GetLoginInfo()['email'] . " is logged in with a password hash of " . $login_handler->GetLoginInfo()['password'] : "******";
<?php /** * Created by PhpStorm. * User: ernestlandrito * Date: 12/7/15 * Time: 10:16 PM */ session_start(); include 'login-session-handler.php'; // Make a login handler and login. $login_handler = new LoginSessionHandler(); $login_handler->Login('*****@*****.**', 'test');
<a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Students<span class="caret"></span></a> <ul class="dropdown-menu"> <li><a href="Find_teacher.html">Find a teacher</a></li> <li><a>Join</a></li> </ul> </li> <li><a href="Teachers.html">Teachers</a></li> <li><a href="Calendar.html">Calendar</a></li> <li><a href="Contact.html">Contact</a></li> </ul> <!-- Login PHP --> <?php session_start(); require 'Session/login-session-handler.php'; $login_handler = new LoginSessionHandler(); // If submitting if ($_SERVER['REQUEST_METHOD'] == "POST") { // Login using the login information if ($login_handler->Login($_POST['email'], $_POST['password'])) { // Alert if success. echo "<script> alert('Email " . $login_handler->GetLoginInfo()['email'] . " has logged in.') </script>"; } else { // Alert if unsusccessful. echo "<script> alert('Unsuccessfully logged in.') </script>"; } } // Check if logged in and set visability. if ($login_handler->IsLoggedIn()) { $login_visability = "hidden"; $username_visablilty = "";
<?php /** * Created by PhpStorm. * User: ernestlandrito * Date: 12/7/15 * Time: 10:25 PM */ session_start(); include 'login-session-handler.php'; // Make an handler and logout. $login_handler = new LoginSessionHandler(); $login_handler->Logout();