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'])) {
|
if(isset($_SESSION['user'])) {
|
||||||
header("Location: /home");
|
header("Location: /home");
|
||||||
}
|
}
|
||||||
?>
|
|
||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en" data-bs-theme="dark">
|
|
||||||
<head>
|
|
||||||
<?php
|
|
||||||
require_once 'core/classes.php';
|
require_once 'core/classes.php';
|
||||||
require_once 'core/classes/User.php';
|
require_once 'core/classes/User.php';
|
||||||
require_once 'core/config.php';
|
require_once 'core/config.php';
|
||||||
|
|
@ -28,6 +24,7 @@ if(isset($_POST['submit'])) {
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
if (password_verify($password, $user->getPassword($con, $username))) {
|
if (password_verify($password, $user->getPassword($con, $username))) {
|
||||||
$_SESSION["user"] = $user->getID($con, $username);
|
$_SESSION["user"] = $user->getID($con, $username);
|
||||||
|
header("Location: /home");
|
||||||
//echo $_SESSION["user"];
|
//echo $_SESSION["user"];
|
||||||
} else {
|
} else {
|
||||||
$passwordiswrong = true;
|
$passwordiswrong = true;
|
||||||
|
|
@ -38,6 +35,9 @@ if(isset($_POST['submit'])) {
|
||||||
$result = file_get_contents("https://useless-facts.sameerkumar.website/api");
|
$result = file_get_contents("https://useless-facts.sameerkumar.website/api");
|
||||||
$thefunfact = json_decode($result);
|
$thefunfact = json_decode($result);
|
||||||
?>
|
?>
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en" data-bs-theme="dark">
|
||||||
|
<head>
|
||||||
</head>
|
</head>
|
||||||
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
<title><?php echo $pagename; ?> | <?php echo $sitename; ?></title>
|
||||||
<body>
|
<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"; } ?>"
|
<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">
|
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>'; } ?>
|
<?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>
|
<button type="submit" class="btn btn-secondary" style="margin-top: 15px; float: right;" name="submit">Login</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue