Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST["Secure"]) and $_POST["Secure"] == true)
- {
- session_start();
- include_once("../connection/connection.php");
- include_once("secure.php");
- include_once("date.php");
- include_once("../lib/Browser.php");
- $Security = new Secure;
- class Login
- {
- public function __construct()
- {
- $database = new Database();
- $db = $database->dbConnection();
- $this->conn = $db;
- }
- public function Check_Login($User_Name, $Password)
- {
- try
- {
- $Sql = "SELECT * FROM `login` WHERE user_name = :user AND password = :pass";
- $Result = $this->conn->prepare($Sql);
- $Result->execute(array(":user"=>$User_Name,":pass"=>$Password));
- $Num_User = $Result->rowCount();
- if($Num_User == 1)
- {
- print_r ("OK");
- $Login_Information = array("Name"=>$Result["name"], "Access"=>$Result["access"]);
- $_SESSION["Is_Login"] = $Login_Information;
- }
- else
- {
- echo "Error_Report";
- }
- }
- catch(PDOException $e)
- {
- print_r($e->__toString());
- }
- }
- }
- $MLogin = new Login;
- $MLogin->Check_Login($Security->cleanMe($_POST["User_Name"]), $Security->cleanMe($_POST["Password"]));
- }
- else
- {
- header("location: ../login.php");
- exit();
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement