public function authenticate(User $user)
 {
     $searchforinput = "Username: "******" Password: "******"\n", $contentfile);
     if (!in_array($searchforinput, $contentfile)) {
         throw new Exception("Wrong name or password");
     }
     $this->userlogin();
 }
 public function authenticate($email, $password)
 {
     $db = new Db();
     $email = $db->quote($email);
     $results = $db->select("select * from users where email = {$email}");
     if (!$results) {
         return FALSE;
     }
     foreach ($results as $result) {
         $user = new User();
         $user->hydrate($result);
     }
     //   if(password_verify($password, $user->getPassword())){
     if ($password == $user->getpassword()) {
         $result = $db->query("update users set lastLogin=now() where email = {$email}");
         if (!$result) {
             return FALSE;
         }
         return $user;
     } else {
         return FALSE;
     }
 }
<?php

session_start();
require_once "User.php";
// Calls user class
$user_object = new User();
$username = $user_object->getusername();
$password = $user_object->getpassword();
?>
	
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--[if lt IE 7 ]><html class="ie ie6" lang="en"> <![endif]-->
<!--[if IE 7 ]><html class="ie ie7" lang="en"> <![endif]-->
<!--[if IE 8 ]><html class="ie ie8" lang="en"> <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html xmlns="http://www.w3.org/1999/xhtml">
<!--<![endif]-->

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>SmartDocument</title>

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Favicons -->
<link rel="shortcut icon" href="images/favicon.ico" />

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->