lil bug fixes
This commit is contained in:
parent
3c26911da3
commit
8c04e314e6
11
login.php
11
login.php
|
|
@ -3,11 +3,7 @@ session_start();
|
|||
if(isset($_SESSION['user'])) {
|
||||
header("Location: /home");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="dark">
|
||||
<head>
|
||||
<?php
|
||||
|
||||
require_once 'core/classes.php';
|
||||
require_once 'core/classes/User.php';
|
||||
require_once 'core/config.php';
|
||||
|
|
@ -28,6 +24,7 @@ if(isset($_POST['submit'])) {
|
|||
if ($result > 0) {
|
||||
if (password_verify($password, $user->getPassword($con, $username))) {
|
||||
$_SESSION["user"] = $user->getID($con, $username);
|
||||
header("Location: /home");
|
||||
//echo $_SESSION["user"];
|
||||
} else {
|
||||
$passwordiswrong = true;
|
||||
|
|
@ -38,6 +35,9 @@ if(isset($_POST['submit'])) {
|
|||
$result = file_get_contents("https://useless-facts.sameerkumar.website/api");
|
||||
$thefunfact = json_decode($result);
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" data-bs-theme="dark">
|
||||
<head>
|
||||
</head>
|
||||
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
||||
<body>
|
||||
|
|
@ -63,6 +63,7 @@ $thefunfact = json_decode($result);
|
|||
<input class="<?php if($passwordiswrong == true) { echo "form-control is-invalid"; } else {echo "form-control form-control-sm"; } ?>"
|
||||
type="password" placeholder="Your password (Minmum 8 characters)" id="inputSmall" name="pass">
|
||||
<?php if($passwordiswrong == true) {echo '<div class="invalid-feedback" bis_skin_checked="1">Password is incorrect.</div>'; } ?>
|
||||
<a href="/register" class="mt-4 float-start">Don't have an account? Register here!</a>
|
||||
<button type="submit" class="btn btn-secondary" style="margin-top: 15px; float: right;" name="submit">Login</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in New Issue