You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
653 B
PHTML

<?php
require_once 'db.inc.php';
$email = $_GET['email'];
$password = $_GET['password'];
$session = init_cass_db();
$statement = $session->prepare('SELECT password_hash FROM users WHERE email=? ALLOW FILTERING;');
$result = $session->execute($statement,array('arguments' => array($email)));
if ($result->count() <= 0) {
echo('Invalid email address or password.');
exit();
} else {
$hash = $result[0]['password_hash'];
if (password_verify($password,$hash) != true) {
echo('Invalid email address or password.');
exit();
} else {
session_start();
$_SESSION['user'] = $email;
header('Location: https://glink.zip?res=success');
}
}
?>