Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include_once '../app/config/config.php';
- include_once '../app/general/Security.php';
- require("../app/securimage/Securimage.php");
- $mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
- if (mysqli_connect_errno()) {
- printf("Error Connection\n", mysqli_connect_error());
- exit;
- }
- sec_session_start(); // Our custom secure way of starting a PHP session.
- if (isset($_POST['email'], $_POST['p'])) {
- $email = $_POST['email'];
- $password = $_POST['p']; // The hashed password.
- $captcha = $_POST['captcha_code'];
- $img = new Securimage();
- if (login($email, $password, $mysqli) == true && $img->check($captcha) == true) {
- // Login success
- header('Location: ../admin/logged.php');
- } else {
- // Login failed
- header('Location: index.php?error=1');
- }
- } else {
- // The correct POST variables were not sent to this page.
- echo 'Invalid Request';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement