Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.25 KB | None | 0 0
  1. <?php
  2.     if(isset($_POST["Secure"]) and $_POST["Secure"] == true)
  3.     {
  4.         session_start();
  5.         include_once("../connection/connection.php");
  6.         include_once("secure.php");
  7.         include_once("date.php");
  8.         include_once("../lib/Browser.php");
  9.         $Security = new Secure;
  10.         class Login
  11.         {
  12.             public function __construct()
  13.             {
  14.                 $database = new Database();
  15.                 $db = $database->dbConnection();
  16.                 $this->conn = $db;     
  17.             }
  18.             public function Check_Login($User_Name, $Password)
  19.             {              
  20.                 try
  21.                 {
  22.                     $Sql = "SELECT * FROM `login` WHERE user_name = :user AND password = :pass";
  23.                     $Result = $this->conn->prepare($Sql);              
  24.                     $Result->execute(array(":user"=>$User_Name,":pass"=>$Password));               
  25.                     $Num_User = $Result->rowCount();   
  26.                     if($Num_User == 1)
  27.                     {                          
  28.                         print_r ("OK");                    
  29.                         $Login_Information = array("Name"=>$Result["name"], "Access"=>$Result["access"]);
  30.                         $_SESSION["Is_Login"] = $Login_Information;                    
  31.                     }
  32.                     else
  33.                     {
  34.                         echo "Error_Report";
  35.                     }
  36.                 }
  37.                 catch(PDOException $e)
  38.                 {
  39.                     print_r($e->__toString());
  40.                 }
  41.             }
  42.         }
  43.         $MLogin = new Login;
  44.         $MLogin->Check_Login($Security->cleanMe($_POST["User_Name"]), $Security->cleanMe($_POST["Password"]));
  45.     }
  46.     else
  47.     {
  48.         header("location: ../login.php");
  49.         exit();
  50.     }
  51. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement